Skip to main content

Date Picker

A date picker combines a date field and a calendar popover to allow users to select a date.

On this page
<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

npx shadcn@latest add @dotui/date-picker

Usage

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

Meeting date
Appointment
Please select a date.
Meeting date
Meetings can't be scheduled in the past.
Meeting date
Hour
Minute
Second
Appointment date
Appointment time
Event date
Event date
Meeting date
Please select a date.
Meeting date

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.

PropType
ReactNode | function
union
Granularity
boolean
12 | 24
function
boolean
boolean
PageBehavior
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.

PropType
boolean
ReactNode | function
union
Granularity
boolean
12 | 24
union
boolean
boolean
PageBehavior
T | null
boolean
RangeValue<T> | null
RangeValue<T> | null
function

Last updated on 6/16/2026