Basic Date Picker
A controlled input and calendar popover.
tsx
const [date, setDate] = useState<Date | null>(null)
<DatePicker selectedDate={date} onChange={setDate} />Component
A controlled calendar input with visual variants, popover animation, and disabled state support.
Live previews paired with copyable source.
A controlled input and calendar popover.
const [date, setDate] = useState<Date | null>(null)
<DatePicker selectedDate={date} onChange={setDate} />Choose a surface treatment that fits your interface.
default
minimal
material
ios
<DatePicker selectedDate={date} onChange={setDate} variant="default" />
<DatePicker selectedDate={date} onChange={setDate} variant="minimal" />
<DatePicker selectedDate={date} onChange={setDate} variant="material" />
<DatePicker selectedDate={date} onChange={setDate} variant="ios" />Change how the calendar enters and exits.
fade
scale
<DatePicker selectedDate={date} onChange={setDate} animation="fade" />
<DatePicker selectedDate={date} onChange={setDate} animation="scale" />Props available on the component.
| Prop | Type | Default | Description |
|---|---|---|---|
| selectedDate | Date | null | required | The currently selected date. |
| onChange | (date: Date) => void | required | Called when the user selects a date. |
| variant | 'default' | 'minimal' | 'accent' | 'neumorphic' | 'dark' | 'playful' | 'material' | 'ios' | 'default' | Controls the input and calendar surface style. |
| animation | 'fade' | 'slide' | 'scale' | 'rotate' | 'none' | 'fade' | Controls the popover entry and exit animation. |
| disabled | boolean | false | Prevents opening the picker. |
| className | string | '' | Additional classes applied to the wrapper. |