Calendar

Date field built on react-day-picker for single, multiple, and range selection.

August 2026
<Calendar  mode="single"  selected={date}  onSelect={setDate}/>

Usage

import { Calendar } from "@reva/ui";

Calendar wraps react-day-picker. Pass mode="single" | "multiple" | "range" and the matching selected / onSelect pair to drive selection. Internally the day cell renders as an IconButton, the prev/next chevrons reuse buttonVariants, and --cell-size controls grid sizing — override via className if you need a denser or larger calendar.

Examples

Range

August 2026
September 2026
<Calendar  mode="range"  selected={range}  onSelect={setRange}  numberOfMonths={2}/>

Multiple

August 2026
<Calendar  mode="multiple"  selected={days}  onSelect={setDays}/>

Caption layout

Use captionLayout="dropdown" to swap the month/year label for month and year dropdowns. Bound the selectable years with startMonth / endMonth.

August 2026
<Calendar  mode="single"  selected={date}  onSelect={setDate}  captionLayout="dropdown"  startMonth={new Date(2015, 0)}  endMonth={new Date(2030, 11)}/>

Props

PropTypeDefaultDescription
mode"single" | "multiple" | "range"Selection model from react-day-picker.
selectedDate | Date[] | DateRange | undefinedSelected day(s); shape depends on mode.
onSelect(value) => voidSelection change handler.
numberOfMonthsnumber1How many month grids to render side-by-side.
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years""label"Header layout for the month/year caption.
buttonVariantButtonProps["variant"]"ghost"Variant applied to the prev/next navigation buttons.
showOutsideDaysbooleantrueRender days from sibling months in the grid.
localeLocaleLocale passed through to react-day-picker.
classNamestringMerged onto the calendar root.

Additional DayPicker props from react-day-picker are forwarded.

On this page