Date Picker
A 44px trigger (48px in Large mode) that opens the Calendar in a popover. The trigger shows the chosen date, or a placeholder in the muted color. Single date and range.
Installation
This component is part of SevenOne Pro.
The Pro license includes the code of every Pro component, the complete Figma file and the Angular version.
Usage
import { DatePicker, DateRangePicker } from "@/components/ui/date-picker"
const [date, setDate] = React.useState<Date | undefined>()
<DatePicker value={date} onValueChange={setDate} />Examples
Single date
Choosing a day closes the popover and returns focus to the trigger.
const [date, setDate] = React.useState<Date | undefined>(new Date(2026, 10, 14))
<DatePicker value={date} onValueChange={setDate} />Range
const [range, setRange] = React.useState<DateRange | undefined>({
from: new Date(2026, 10, 12),
to: new Date(2026, 10, 18),
})
<DateRangePicker value={range} onValueChange={setRange} />Empty
<DatePicker value={date} onValueChange={setDate} placeholder="Pick a date" />With label and hint
Month and year menus help when the date is far away, like a date of birth.
This is a hint text to help user.
<Field className="w-70">
<FieldLabel id="dob-label" htmlFor="dob">Date of birth</FieldLabel>
<DatePicker
id="dob"
labelId="dob-label"
value={date}
onValueChange={setDate}
aria-describedby="dob-hint"
calendarProps={{
captionLayout: "dropdown",
startMonth: new Date(1920, 0),
endMonth: new Date(2026, 11),
}}
/>
<FieldDescription id="dob-hint">This is a hint text to help user.</FieldDescription>
</Field>Accessibility
- The trigger is a button whose name includes the current value ("Pick a date" or the date). With labelId, it is read as "Date of birth, November 14th, 2026" (WCAG 4.1.2).
- The popover moves focus into the calendar grid and returns it to the trigger on close (WCAG 2.4.3).
- For dates far away, use the month and year menus or offer a typed input as an alternative (WCAG 2.1.1, 3.3.2).
- 44px trigger, 44px day cells, 16px text (WCAG 2.5.5).