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

PropTypeDefaultDescription
valueDate | null—Controlled selected date
defaultValueDate | nullnullUncontrolled initial value
onValueChange(date: Date | null) => void—Fires when a new day is picked
placeholderstring'Pick a date'Text when no date is selected
disabledbooleanfalseDisable the trigger
minDateDate—Earliest selectable date (inclusive)
maxDateDate—Latest selectable date (inclusive)
isDateDisabled(date: Date) => boolean—Disable arbitrary dates
weekStartsOn0 | 100 = Sunday, 1 = Monday
formatValue(date: Date) => string—Custom formatter for the trigger label
aria-labelstring—Accessible label for the trigger
size'sm' | 'md' | 'lg''md'Trigger size, the same height as an Input of that size
aria-labelledbystring—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
sxStyleXStyles—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

KeyAction
Enter / Space (on trigger)Open calendar
EscapeClose and return focus to trigger
Arrow keys (in calendar)Navigate dates
Enter (in calendar)Select focused day and close