Date picker
Choose a date in a designed popover calendar.
Installation
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/date-picker.jsonThe registry includes the shared styles and dependencies. Import @/components/apple-ui/styles.css in your root layout once. For the package route, use the installation guide.
Usage
<DatePicker
label="Departure date"
value={date}
onChange={(event) => setDate(event.target.value)}
min="2026-01-01"
/>Package imports use @eduardoul/apple-ui. Registry imports use @/components/apple-ui. Add "use client" to files that use state or event handlers.
API reference
| Property | Type | Default |
|---|---|---|
| label | string | Date |
| value | YYYY-MM-DD string | uncontrolled |
| onChange | native input callback | undefined |
| onValueChange | value and Date callback | undefined |
| min / max | YYYY-MM-DD string | undefined |
| locale | string | runtime locale |
| weekStartsOn | 0 | 1 | 0 |
| clearable | boolean | true |
Use className and style to customize the component. The package includes full TypeScript definitions for its supported element properties and refs.
Design guidance
- The popover returns focus to its trigger after selection or dismissal.
- Show date constraints before someone makes a selection.
- Use onChange when existing form code expects a native input event.
- Set clearable to false for a compact date capsule without a clear action.
Accessibility
Provide a visible label or accessible name. Keep keyboard focus visible and check the example with your content at 200 percent zoom. Overlays use Radix for focus management and keyboard dismissal.
Library styles support reduced motion, reduced transparency, increased contrast and forced colors. Read the accessibility foundation for the checks your application still needs.