On this page
2/3/2020
<DatePicker
aria-label="Meeting date"
defaultValue={parseDate('2020-02-03')}
>
<InputGroup>
<DateInput />
<InputGroupAddon>
<Button variant="default" size="sm" isIconOnly>
<CalendarIcon />
</Button>
</InputGroupAddon>
</InputGroup>
<Popover>
<DialogContent>
<Calendar />
</DialogContent>
</Popover>
</DatePicker>Installation
npm
pnpm
yarn
bun
npx shadcn@latest add @dotui/date-pickerUsage
Use date pickers to allow users to select a date using a field and a calendar popover.
import { CalendarIcon } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Calendar } from '@/components/ui/calendar'
import { DatePicker } from '@/components/ui/date-picker'
import { DialogContent } from '@/components/ui/dialog'
import { Label } from '@/components/ui/field'
import { DateInput, InputAddon, InputGroup } from '@/components/ui/input'
import { Overlay } from '@/components/ui/overlay'<DatePicker>
<Label>Date</Label>
<InputGroup>
<DateInput />
<InputAddon>
<Button variant="default" size="sm" isIconOnly>
<CalendarIcon />
</Button>
</InputAddon>
</InputGroup>
<Overlay type="popover" mobileType="drawer">
<DialogContent>
<Calendar />
</DialogContent>
</Overlay>
</DatePicker>Examples
2/3/2020
Meeting date
mm/dd/yyyy
mm/dd/yyyy
AppointmentPlease select a date.
mm/dd/yyyy
Meeting dateMeetings can't be scheduled in the past.
mm/dd/yyyy
Meeting date
mm/dd/yyyy
Hour
4/7/2021, 6 PM UTC
Minute
4/7/2021, 6:45 PM UTC
Second
4/7/2021, 6:45:22 PM UTC
Appointment date
mm/dd/yyyy, ––:––
11/7/2021, 7:45 AM UTC
Appointment time
11/7/2022, 10:45 AM
mm/dd/yyyy
Event date
1/1/1980
Event date
mm/dd/yyyy
Meeting datePlease select a date.
mm/dd/yyyy
2/3/2020
Meeting date
2/3/2020
selected date: 2020-02-03
API Reference
DatePicker
A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
union | — | ||
Granularity | — | ||
boolean | false | ||
12 | 24 | — | ||
function | — | ||
boolean | — | ||
boolean | — | ||
PageBehavior | visible | ||
T | null | — | ||
boolean | — | ||
T | null | — | ||
T | null | — | ||
function | — | ||
DateRangePicker
A date range picker combines two DateFields and a RangeCalendar popover to allow users to enter or select a date and time range.
| Prop | Type | Default | |
|---|---|---|---|
boolean | — | ||
ReactNode | function | — | ||
union | — | ||
Granularity | — | ||
boolean | false | ||
12 | 24 | — | ||
union | — | ||
boolean | — | ||
boolean | — | ||
PageBehavior | visible | ||
T | null | — | ||
boolean | — | ||
RangeValue<T> | null | — | ||
RangeValue<T> | null | — | ||
function | — | ||
Last updated on 6/16/2026