This page as markdown: /calendar.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

Calendar

Status: stable

Date picker grid wrapping react-day-picker v9, themed entirely with semantic tokens (no external stylesheet). Supports single, multiple, and range selection; nav chevrons render through the injected icon set.

Keywords: calendar, date grid, month, schedule

Usage

Use Calendar to browse or choose dates in a month grid, especially when relative date position matters.

Best practices

Props

Name Type Default Description
mode "single" | "multiple" | "range" — Selection behavior. Pair with the matching selected/onSelect shape (Date, Date[], or DateRange).
selected Date | Date[] | DateRange | undefined — The controlled selection. Shape follows mode.
onSelect (value, triggerDate, modifiers, event) => void — Fires when a day is chosen. The first argument's type follows mode.
defaultMonth Date — The month shown on first render (uncontrolled navigation).
month Date — Controlled displayed month; pair with onMonthChange.
numberOfMonths number 1 How many month grids to render. They sit side by side where the space holds them and wrap below one another where it does not, judged on the calendar's own room (a narrow popover on a wide screen stacks them), not the viewport.
disabled Matcher | Matcher[] — Days matching this are dimmed and non-selectable (e.g. { before: new Date() }).
showOutsideDays boolean true Render leading/trailing days from adjacent months, dimmed.
bare boolean false Drop the card frame (border, fill, padding) so the grid sits flush inside a surface that already has one, such as a Popover. DatePicker renders its Calendar this way.
motion "full" | "subtle" | "off" "full" How much motion this component uses: full inherits the app's policy, subtle keeps feedback and drops the month slide, off stills it. It can only turn motion down — it never overrides a reader's reduce-motion setting.
className string — Merged onto the bordered card container that wraps the grid.
classNames Partial — Per-part class overrides merged over the themed defaults. Themed slots: months, month, nav, button_previous, button_next, month_caption, caption_label, month_grid, weekdays, weekday, week, day, day_button, range_start, range_middle, range_end, selected, today, outside, disabled, hidden. Selection/state slots (selected/today/range_*/outside/disabled) style the day CELL; the inner day button is targeted via the [&>button] descendant.
components Partial — Render overrides for RDP parts. Chevron is supplied by default and merged with yours.

Variants

Tokens used

card, card-foreground, border, primary, primary-foreground, accent, accent-foreground, muted-foreground, ring

Motion

Accessibility

Related

Examples

Single date

import { Calendar } from "@sableui/react"

const [date, setDate] = useState<Date>()
<Calendar mode="single" selected={date} onSelect={setDate} />

Range

import { Calendar, type DateRange } from "@sableui/react"

const [range, setRange] = useState<DateRange>()
<Calendar mode="range" selected={range} onSelect={setRange} numberOfMonths={2} />