Date Picker
A UI component that provides an interactive way to select a single date from a calendar view, supporting navigation between months and years for date picking.
Installation
Install the component via the CLI in one command.
npx shadcn@latest add @intentui/date-picker
Composed components
When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.
Manual installation
Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.
npm install tailwind-merge react-aria-components @heroicons/react
Examples
Date and time
While not a full-fledged date-time picker, this setup lets you edit both date and time in a segmented field.
Validation
To ensure that the date picker is filled out, use the isRequired prop.
Custom validation
The validate function is your go-to for custom validation rules. It checks the current date value and returns an error message string or strings if the value doesn't meet your criteria.
Controlled
Take control of your date picker by passing a value prop, which allows you to manage the selected date.
Disabled
When the date picker is disabled, it becomes non-interactive and visually represents a disabled state.
Component API
DatePicker
The DatePicker component combines a date field with a calendar popover.
| Prop | Type | Default |
|---|---|---|
className | string | - |
popover | Omit<PopoverProps, "children"> | - |
DatePickerOverlay
The DatePickerOverlay component renders the calendar popover for a date picker.
| Prop | Type | Default |
|---|---|---|
pageBehavior | "visible" | "single" | visible |
range | boolean | - |
visibleDuration | DateDuration | { months: 1 } |
DatePickerTrigger
The DatePickerTrigger component wraps the date picker trigger controls.
| Prop | Type | Default |
|---|---|---|
className | string | - |
See the React Aria for the full API reference.
Unlock the full power ofIntent UI Design
Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.