DatePicker is a field that opens a calendar; DateRangePicker is a panel with quick presets; Calendar is the grid they share.
Default
A date field inside a Field: click it to pick a day from the calendar.
Your client sees this on the proposal.
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add date-pickerBrings the 2 files it builds on (floating.tsx, glyph.tsx). The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/date-picker.tsx.
import { formatDate, Calendar, DatePicker, defaultRangePresets, DateRangePicker } from "@/design-system/components/date-picker";Usage
<Field id="due" label="Due date" required>
<DatePicker id="due" value={due} onChange={setDue} />
</Field>
<DateRangePicker value={range} onChange={setRange} />Examples
Allowed dates
min and max grey out days outside the window, e.g. a deadline before launch.
Pick a day between Dec 1 and Dec 18, before the launch.
Error and disabled
Red border with an error message, and a locked field that can't be changed.
Choose a start date for Brand refresh.
Inline calendar
The Calendar on its own, always open, for a panel or sidebar.
November 2026
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Kickoff: Nov 24, 2026
Date range
Presets on the left and a range calendar on the right, for reports.
November 2026
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Range: Nov 2, 2026 - Nov 13, 2026
When to use
Use it when
- A deadline, start date or due date (DatePicker)
- A reporting period: last 7 days, month to date (DateRangePicker)
Don’t use it when
- Only a month or year → Field and inputs (Select)
- A time of day → Field and inputs (Input type=time)
Rules
- Values are ISO strings "YYYY-MM-DD"; show them with formatDate()
- Wrap DatePicker in Field for the label
- The calendar opens below the field, or above when there's no room, in the top layer so no scrolling parent crops it (useFloating)
- DateRangePicker on the page takes surface="inline" (no shadow); the default popover surface is for one opened from a button
Properties
DatePicker
| Prop | Type | Default |
|---|---|---|
id * | string | – |
value * | string | null | – |
onChange * | (value: string | null) => void | – |
placeholder | string | "Select date" |
disabled | boolean | false |
min | string | – |
max | string | – |
name | string | – |
aria-invalid | boolean | – |
aria-describedby | string | – |
className | string | – |
DateRangePicker
| Prop | Type | Default |
|---|---|---|
value * | DateRange | – |
onChange * | (range: DateRange) => void | – |
presets | DateRangePreset[] | defaultRangePresets |
min | string | – |
max | string | – |
className | string | – |
* required
Accessibility
- Grid with arrow keys, PageUp/PageDown for months; Escape closes and returns focus