DatePicker
An input-style trigger that opens a Calendar in a Popover for selecting a single date.
Import
import { DatePicker } from '@matix/components/date-picker';Usage
Constrained Range
Disabled
Set disabled to make the trigger non-interactive.
Custom Label Format
Pass formatValue to control how the selected date renders in the trigger.
<DatePicker
formatValue={(d) =>
d.toLocaleDateString('en-GB', {
weekday: 'short',
day: 'numeric',
month: 'short',
})
}
/>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | null | — | Controlled selected date |
defaultValue | Date | null | null | Uncontrolled initial value |
onValueChange | (date: Date | null) => void | — | Fires when a new day is picked |
placeholder | string | 'Pick a date' | Text when no date is selected |
disabled | boolean | false | Disable the trigger |
minDate | Date | — | Earliest selectable date (inclusive) |
maxDate | Date | — | Latest selectable date (inclusive) |
isDateDisabled | (date: Date) => boolean | — | Disable arbitrary dates |
weekStartsOn | 0 | 1 | 0 | 0 = Sunday, 1 = Monday |
formatValue | (date: Date) => string | — | Custom formatter for the trigger label |
aria-label | string | — | Accessible label for the trigger |
size | 'sm' | 'md' | 'lg' | 'md' | Trigger size, the same height as an Input of that size |
aria-labelledby | string | — | IDs of the label elements. The name keeps the selected date |
labels | { previousMonth?, nextMonth?, popup?, grid? } | — | Screen-reader text, for translation. popup names the popup when there is no aria-label, and grid names the day grid |
icons | { trigger?, previous?, next? } | — | Replaces the built-in icons. See the Icons guide |
sx | StyleXStyles | — | StyleX override for the trigger |
All other button attributes, such as id and aria-describedby, go to the trigger.
Accessibility
- Trigger is a
<button>and inherits all Popover dismiss behavior (Escape, outside click). - Popup uses focus management from Base UI Popover — focus returns to the trigger on close.
- The inner Calendar exposes full keyboard navigation (see the Calendar docs).
Keyboard
| Key | Action |
|---|---|
Enter / Space (on trigger) | Open calendar |
Escape | Close and return focus to trigger |
| Arrow keys (in calendar) | Navigate dates |
Enter (in calendar) | Select focused day and close |