- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/date-picker.json
Usage
import { DatePicker, DatePickerCalendar, DatePickerClearTrigger, DatePickerContent, DatePickerControl, DatePickerInput, DatePickerLabel, DatePickerPositioner, DatePickerTrigger, } from "@/components/ui/date-picker";
<DatePicker selectionMode="single"> <DatePickerLabel>Pick a date</DatePickerLabel> <DatePickerControl> <DatePickerInput index={0} placeholder="Select date" /> <DatePickerTrigger /> <DatePickerClearTrigger asChild> <Button size="sm" variant="outline">Clear</Button> </DatePickerClearTrigger> </DatePickerControl> <DatePickerPositioner> <DatePickerContent> <DatePickerCalendar /> </DatePickerContent> </DatePickerPositioner> </DatePicker>
Examples
Input
Use DatePickerInput for a text input with calendar icon that opens the date picker.
Range
Select a date range with selectionMode="range".
Time
Use <DatePickerTimer /> for time selection.
With Presets
Add quick single-date presets in a side panel.
Custom format
Customize the format of the presets using external date formatting library like date-fns.
API Reference
DatePicker
Root element. Extends Calendar.
| Prop | Type | Default |
|---|---|---|
value | DateValue[] | - |
defaultValue | DateValue[] | - |
onValueChange | (details: ValueChangeDetails) => void | - |
selectionMode | "single" | "range" | "multiple" | "single" |
positioning | PositioningOptions | { placement: "top" } |
lazyMount | boolean | - |
unmountOnExit | boolean | - |
DatePickerTrigger
Button that opens the date picker. button
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
DatePickerInput
Input with calendar icon that opens the date picker on click. input
| Prop | Type | Default |
|---|---|---|
placeholder | string | - |
index | number | - |
size | "sm" | "md" | "lg" | - |
className | string | - |
DatePickerContent
Wraps the calendar. Inherits --cell-size from calendar for date cell sizing.
| Prop | Type | Default |
|---|---|---|
className | string | - |
| Attribute | Default |
|---|---|
--cell-size | --spacing(8) |
DatePickerValue
Displays the selected date(s) as text. Use inside DatePickerTrigger. span
| Prop | Type | Default |
|---|---|---|
placeholder | string | - |
className | string | - |
asChild | boolean | - |
DatePickerTimer
Time input for selecting hour and minute. Use alongside the calendar for date-time selection. input
| Prop | Type | Default |
|---|---|---|
value | string | - |
defaultValue | string | - |
onValueChange | (details: ValueChangeDetails) => void | - |
className | string | - |
DatePickerPresetTrigger
Quick preset button for dates. button
| Prop | Type | Default |
|---|---|---|
className | string | - |
value | DateValue[] | - |
asChild | boolean | - |
For a complete list of props, see the Ark UI documentation.