Date Picker
A date picker component with range and presets.
Examples
Default
Preview
Floating Label
Preview
Small (size)
Preview
Small size with helper text
Preview
Pick a date from the calendar
Small size states (helper, disabled, invalid)
Preview
Optional field
Field is disabled
This field is required
With min/max
Preview
With Custom Year Range
Preview
Without Year Selector
Preview
With helper text
Preview
Pick a date from the calendar
With floating label and helper text
Preview
Pick a date from the calendar
Disabled
Preview
Field is disabled
Invalid (error)
Preview
This field is required
Date Range Picker
Preview
Date Range Picker small (size)
Preview
Date Range Picker small with helper text
Preview
Select the desired date range
Date Range Picker small states (disabled, invalid)
Preview
Field is disabled
This field is required
Date Range Picker with helper text
Preview
Select the desired date range
Date Range Picker disabled
Preview
Field is disabled
Date Range Picker invalid (error)
Preview
This field is required
API
DatePicker
| Property | Type | Default | Description |
|---|---|---|---|
| value | Date | null | - | Controlled selected value. |
| defaultValue | Date | null | null | Uncontrolled initial value. |
| onValueChange | (value: Date | null) => void | - | Called when the user picks/clears a date. |
| min / max | Date | - | Disables dates outside the bounds. |
| placeholder | string | ”Pick a date” | Text shown when no date is selected. |
| format | (date: Date) => string | - | Custom date formatting function. |
| disabled | boolean | false | Disables the date picker. |
| className | string | - | Additional CSS classes for the container. |
| yearRange | { start: number; end: number } | { start: 1900, end: 2100 } | Range of years to display in the year selector. |
| showYearSelector | boolean | true | Whether to show the year selector dropdown. When false, the year is displayed as static text instead of a dropdown. |
| invalid | boolean | false | When true, applies error state styling to the trigger and DatePickerText. |
| size | ”lg” | “md" | "lg” | Trigger size. “md” renders a compact variant matching Input size=“md”. |
DateRangePicker
| Property | Type | Default | Description |
|---|---|---|---|
| value | { start: Date | null; end: Date | null } | null | - | Controlled selected range value. |
| defaultValue | { start: Date | null; end: Date | null } | null | null | Uncontrolled initial range value. |
| onValueChange | (value: { start: Date | null; end: Date | null } | null) => void | - | Called when the user picks/clears a date range. |
| min / max | Date | - | Disables dates outside the bounds. |
| placeholder | string | ”Select date range” | Text shown when no range is selected. |
| format | (date: Date) => string | - | Custom date formatting function. |
| disabled | boolean | false | Disables the date range picker. |
| yearRange | { start: number; end: number } | { start: 1900, end: 2100 } | Range of years to display in the year selector. |
| showYearSelector | boolean | true | Whether to show the year selector dropdown. When false, the year is displayed as static text instead of a dropdown. |
| invalid | boolean | false | When true, applies error state styling to the trigger and DatePickerText. |
| size | ”lg” | “md" | "lg” | Trigger size. “md” renders a compact variant matching Input size=“md”. |
DatePickerText
Helper text displayed below the date picker trigger. Styled as error text when the parent DatePicker or DateRangePicker has invalid={true}.
| Property | Type | Description |
|---|---|---|
| children | React.ReactNode | Helper or error message. Use as child of DatePicker or DateRangePicker. |
| className | string | Additional CSS classes. |
DatePickerWrapper
| Property | Type | Description |
|---|---|---|
| className | string | Additional CSS classes for the wrapper. |
| children | React.ReactNode | Child components (typically Label/DatePickerLabel and DatePicker). |
DatePickerLabel
| Property | Type | Description |
|---|---|---|
| htmlFor | string | Associates the label with a DatePicker id. |
| className | string | Additional CSS classes for the label. |
| children | React.ReactNode | Label text. |
Last updated on