Skip to content

Calendar

Data Display

Calendar for single, multiple, or range date selection.

Single dateMultiple datesDate rangeMonth navigation
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Calendar wraps react-day-picker. Set mode to single, multiple, or range and pair selected with onSelect. defaultMonth controls the initial visible month.

Import
import { Calendar } from "@dashboardpack/core/components/ui/calendar";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Calendar props
PropType / DefaultDescription
modesingle | multiple | range

Default: —

Enable a date selection mode.
selectedDate | Date[] | DateRange

Default: —

Shape depends on mode.
onSelectOnSelectHandler

Default: —

Receives the mode-specific selection.
defaultMonthDate

Default: current month

Initial displayed month.
disabledMatcher | Matcher[]

Default: —

Dates unavailable for selection.
showOutsideDaysboolean

Default: true

Display days from adjacent months.

Build with these too