DatePicker
Props
API reference for DatePicker. For usage examples, see the React tab.
DatePicker
| Name | Type | Default |
|---|---|---|
| children | ChildrenOrFunction<DatePickerRenderProps> | |
The children of the component. A function may be provided to alter the children based on component state. | ||
| defaultFocusedValue | DateValue | null | |
The date that is focused when the calendar first mounts (uncontrolled). | ||
| defaultOpen | boolean | |
Whether the overlay is open by default (uncontrolled). | ||
| description | string | |
| firstDayOfWeek | "fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed" | |
The day that starts the week. | ||
| focusedValue | DateValue | null | |
Controls the currently focused date within the calendar. | ||
| granularity | Granularity | |
Determines the smallest unit that is displayed in the date picker. By default, this is | ||
| hideOutsideDays | boolean | false |
Hides days that belong to the previous or next month. The cells stay in the grid so week columns remain aligned. | ||
| hideTimeZone | boolean | false |
Whether to hide the time zone abbreviation. | ||
| hourCycle | 12 | 24 | |
Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. | ||
| isDateHighlighted | ((date: T) => boolean) | |
| isDateUnavailable | ((date: DateValue) => boolean) | |
Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. | ||
| isDisabled | boolean | |
Whether the input is disabled. | ||
| isInvalid | boolean | |
Whether the input value is invalid. | ||
| isOpen | boolean | |
Whether the overlay is open by default (controlled). | ||
| isReadOnly | boolean | |
Whether the input can be selected but not changed by the user. | ||
| isRequired | boolean | |
Whether user input is required on the input before form submission. | ||
| label | string | |
| maxValue | DateValue | null | |
The maximum allowed date that a user may select. | ||
| minValue | DateValue | null | |
The minimum allowed date that a user may select. | ||
| pageBehavior | PageBehavior | visible |
Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration. | ||
| placeholderValue | DateValue | null | |
A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today's date at midnight. | ||
| shouldCloseOnSelect | boolean | (() => boolean) | true |
Determines whether the date picker popover should close automatically when a date is selected. | ||
| shouldForceLeadingZeros | boolean | |
Whether to always show leading zeros in the month, day, and hour fields. By default, this is determined by the user's locale. | ||
| size | DateFieldSize | "md" |
Controls field height, padding, and segment typography. | ||
| visibleDuration | DateDuration | { months: 1 } |
The amount of days that will be displayed at once. This affects how pagination works. | ||
| compactDeprecated | boolean | |
Use | ||
DateField.Root
| Name | Type | Default |
|---|---|---|
| children | ChildrenOrFunction<DatePickerRenderProps> | |
The children of the component. A function may be provided to alter the children based on component state. | ||
| defaultFocusedValue | DateValue | null | |
The date that is focused when the calendar first mounts (uncontrolled). | ||
| defaultOpen | boolean | |
Whether the overlay is open by default (uncontrolled). | ||
| description | string | |
| firstDayOfWeek | "fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed" | |
The day that starts the week. | ||
| focusedValue | DateValue | null | |
Controls the currently focused date within the calendar. | ||
| granularity | Granularity | |
Determines the smallest unit that is displayed in the date picker. By default, this is | ||
| hideOutsideDays | boolean | false |
Hides days that belong to the previous or next month. The cells stay in the grid so week columns remain aligned. | ||
| hideTimeZone | boolean | false |
Whether to hide the time zone abbreviation. | ||
| hourCycle | 12 | 24 | |
Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. | ||
| isDateHighlighted | ((date: T) => boolean) | |
| isDateUnavailable | ((date: DateValue) => boolean) | |
Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. | ||
| isDisabled | boolean | |
Whether the input is disabled. | ||
| isInvalid | boolean | |
Whether the input value is invalid. | ||
| isOpen | boolean | |
Whether the overlay is open by default (controlled). | ||
| isReadOnly | boolean | |
Whether the input can be selected but not changed by the user. | ||
| isRequired | boolean | |
Whether user input is required on the input before form submission. | ||
| label | string | |
| maxValue | DateValue | null | |
The maximum allowed date that a user may select. | ||
| minValue | DateValue | null | |
The minimum allowed date that a user may select. | ||
| pageBehavior | PageBehavior | visible |
Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration. | ||
| placeholderValue | DateValue | null | |
A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today's date at midnight. | ||
| shouldCloseOnSelect | boolean | (() => boolean) | true |
Determines whether the date picker popover should close automatically when a date is selected. | ||
| shouldForceLeadingZeros | boolean | |
Whether to always show leading zeros in the month, day, and hour fields. By default, this is determined by the user's locale. | ||
| size | DateFieldSize | "md" |
Controls field height, padding, and segment typography. | ||
| visibleDuration | DateDuration | { months: 1 } |
The amount of days that will be displayed at once. This affects how pagination works. | ||
| compactDeprecated | boolean | |
Use | ||
DateField.Calendar
| Name | Type | Default |
|---|---|---|
| defaultFocusedValue | DateValue | null | |
The date that is focused when the calendar first mounts (uncontrolled). | ||
| firstDayOfWeek | "fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed" | |
The day that starts the week. | ||
| focusedValue | DateValue | null | |
Controls the currently focused date within the calendar. | ||
| hideOutsideDays | boolean | false |
Hides days that belong to the previous or next month. The cells stay in the grid so week columns remain aligned. | ||
| isDateHighlighted | ((date: T) => boolean) | |
| pageBehavior | PageBehavior | visible |
Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration. | ||
| visibleDuration | DateDuration | { months: 1 } |
The amount of days that will be displayed at once. This affects how pagination works. | ||
DateField.Description
| Name | Type | Default |
|---|---|---|
| about | string | |
| accessKey | string | |
| autoSave | string | |
| children | ReactNode | |
| color | string | |
| content | string | |
| contextMenu | string | |
| dangerouslySetInnerHTML | { __html: string | TrustedHTML; } | |
| datatype | string | |
| defaultChecked | boolean | |
| elementType | string | |
| exportparts | string | |
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts (opens in new tab) | ||
| inlist | any | |
| inputMode | "decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | |
Hints at the type of data that might be entered by the user while editing the element or its contents | ||
| itemID | string | |
| itemProp | string | |
| itemRef | string | |
| itemScope | boolean | |
| itemType | string | |
| part | string | |
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part (opens in new tab) | ||
| prefix | string | |
| property | string | |
| radioGroup | string | |
| rel | string | |
| resource | string | |
| results | number | |
| rev | string | |
| security | string | |
| title | string | |
| typeof | string | |
| unselectable | "off" | "on" | |
| vocab | string | |
DateField.FieldError
| Name | Type | Default |
|---|---|---|
| children | ChildrenOrFunction<FieldErrorRenderProps> | |
The children of the component. A function may be provided to alter the children based on component state. | ||
| elementType | string | 'span' |
The HTML element type to render. Defaults to | ||
DateField.InputGroup
| Name | Type | Default |
|---|---|---|
| about | string | |
| accessKey | string | |
| autoSave | string | |
| children | ChildrenOrFunction<GroupRenderProps> | |
The children of the component. A function may be provided to alter the children based on component state. | ||
| color | string | |
| content | string | |
| contextMenu | string | |
| dangerouslySetInnerHTML | { __html: string | TrustedHTML; } | |
| datatype | string | |
| defaultChecked | boolean | |
| exportparts | string | |
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts (opens in new tab) | ||
| inlist | any | |
| inputMode | "decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | |
Hints at the type of data that might be entered by the user while editing the element or its contents | ||
| itemID | string | |
| itemProp | string | |
| itemRef | string | |
| itemScope | boolean | |
| itemType | string | |
| part | string | |
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part (opens in new tab) | ||
| prefix | string | |
| property | string | |
| radioGroup | string | |
| rel | string | |
| resource | string | |
| results | number | |
| rev | string | |
| security | string | |
| size | DateFieldSize | md |
Controls field height, padding, and segment typography. | ||
| title | string | |
| typeof | string | |
| unselectable | "off" | "on" | |
| vocab | string | |
| compactDeprecated | boolean | |
Use | ||
DateField.Label
| Name | Type | Default |
|---|---|---|
| about | string | |
| accessKey | string | |
| autoSave | string | |
| children | ReactNode | |
| color | string | |
| content | string | |
| contextMenu | string | |
| dangerouslySetInnerHTML | { __html: string | TrustedHTML; } | |
| datatype | string | |
| defaultChecked | boolean | |
| elementType | string | |
| exportparts | string | |
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts (opens in new tab) | ||
| htmlFor | string | |
| inlist | any | |
| inputMode | "decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | |
Hints at the type of data that might be entered by the user while editing the element or its contents | ||
| isDisabled | boolean | |
Whether the Label is on a disabled input or element. | ||
| isRequired | boolean | |
Whether the Label is on a required input or element. | ||
| itemID | string | |
| itemProp | string | |
| itemRef | string | |
| itemScope | boolean | |
| itemType | string | |
| part | string | |
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part (opens in new tab) | ||
| prefix | string | |
| property | string | |
| radioGroup | string | |
| rel | string | |
| resource | string | |
| results | number | |
| rev | string | |
| security | string | |
| title | string | |
| typeof | string | |
| unselectable | "off" | "on" | |
| vocab | string | |
DateField.Popover
| Name | Type | Default |
|---|---|---|
| children (required) | ReactNode | |
The content rendered inside the popover. | ||
| arrowBoundaryOffset | number | 0 |
The minimum distance the arrow's edge should be from the edge of the overlay element. | ||
| arrowRef | RefObject<Element | null> | |
A ref for the popover arrow element. | ||
| boundaryElement | Element | document.body |
Element that that serves as the positioning boundary. | ||
| containerPadding | number | 12 |
The placement padding that should be applied between the element and its surrounding container. | ||
| crossOffset | number | 0 |
The additional offset applied along the cross axis between the element and its anchor element. | ||
| defaultOpen | boolean | |
Whether the overlay is open by default (uncontrolled). | ||
| getTargetRect | ((target: Element) => DOMRect | null) | target.getBoundingClientRect() |
Overrides the target element's bounding rectangle. Useful for positioning relative to a specific point such as the mouse cursor (e.g. context menus) or text selection. | ||
| isEntering | boolean | |
Whether the popover is currently performing an entry animation. | ||
| isExiting | boolean | |
Whether the popover is currently performing an exit animation. | ||
| isKeyboardDismissDisabled | boolean | false |
Whether pressing the escape key to close the popover should be disabled. Most popovers should not use this option. When set to true, an alternative way to close the popover with a keyboard must be provided. | ||
| isNonModal | boolean | |
Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies. Most popovers should not use this option as it may negatively impact the screen reader experience. Only use with components such as combobox, which are designed to handle this situation carefully. | ||
| isOpen | boolean | |
Whether the overlay is open by default (controlled). | ||
| maxHeight | number | |
The maxHeight specified for the overlay element. By default, it will take all space up to the current viewport height. | ||
| offset | number | 8 |
The additional offset applied along the main axis between the element and its anchor element. | ||
| placement | Placements | |
The placement of the element with respect to its anchor element. | ||
| scrollRef | RefObject<Element | null> | overlayRef |
A ref for the scrollable region within the overlay. | ||
| shouldFlip | boolean | true |
Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely. | ||
| shouldSkipAnimation | boolean | |
Whether the popover should appear and disappear without an entry or exit animation. This is used by components such as PreviewTrigger to skip animations when quickly swapping between overlays. | ||
| shouldUpdatePosition | boolean | true |
Whether the overlay should update its position automatically. | ||
| trigger | string | |
The name of the component that triggered the popover. This is reflected on the element as the | ||
| triggerRef | RefObject<Element | null> | |
The ref for the element which the popover positions itself with respect to. When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc., this is set automatically. It is only required when used standalone. | ||