Month grid with ISO date keys, min/max bounds and full keyboard navigation.
Design intent
A native date input renders browser chrome that cannot be themed and differs per browser. Calendar is the visible grid behind a date field: controlled by ISO strings so a timezone cannot shift the chosen day, keyboard-operable cell by cell, and usable standalone or inside a Popover.
npx @slipstream-ui/cli@latest add calendarSelected: 2026-11-13
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Selected day as `YYYY-MM-DD` (controlled). |
| defaultValue | string | — | Initial day when uncontrolled. |
| onValueChange | (value: string) => void | — | Fired with the ISO key. |
| min / max | string | — | Selectable bounds, inclusive. |
| weekStartsOn | 0 | 1 | 0 | Sunday or Monday first. |
| locale | string | 'en-US' | BCP-47 locale for month and weekday labels. |
| showOutsideDays | boolean | true | Render trailing/leading days from adjacent months. |
| isDateDisabled | (value: string) => boolean | — | Block individual days. |
| autoFocus | boolean | false | Focus the active day on mount. |
| disabled | boolean | — | Disables the grid and month controls. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't store Date objects
A Date crossing a timezone boundary can land on the previous or next day. Keep ISO `YYYY-MM-DD` keys until you need to format them.
tsx// AvoidonValueChange={(d) => setDate(d.toISOString())}// PreferonValueChange={setDateKey}Don't disable days by removing them
Removing cells breaks the grid rhythm and keyboard movement. Mark them with min/max/isDateDisabled so they stay visible.
Accessibility
- role=grid with rows, columnheaders and gridcells; the month label is announced politely.
- Arrow keys move by day or week, Home/End jump to the week bounds, PageUp/PageDown change month, Enter selects.
- One tab stop: roving tabindex keeps the grid compact for keyboard users.
- Today uses aria-current="date"; selection uses aria-selected on the cell.
Content guidelines
Day labels
- Use the full date as the accessible name
- Keep visible cells to the day number
Good examples
- 13
Bad examples
- Nov 13
Composition
Compose with Popover: Wrap Calendar in PopoverContent for a date field
<PopoverContent><Calendar autoFocus /></PopoverContent>
Compose with DatePickerPopover: Use DatePickerPopover when the field and panel should ship together
<DatePickerPopover value={date} onValueChange={setDate} />
Related components: DatePicker, DatePickerPopover, Popover, DateRangePicker
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.