ValyroUI Русская версия

Calendar

An inline month grid: one date or a range, several months, unavailable days, your own day content. Free, MIT · Forms and input › Date and time

Installation

npx valyro-cli@latest add calendar
npx shadcn@latest add https://valyro.xyz/r/calendar.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Calendar } from 'valyro-ui';

Props

PropTypeDefault
mode'single' | 'range'single: one date (default). range: a start and an end, with a live preview of the band.
valueDate | null | DateRangeControlled value; use with onValueChange.
defaultValueDate | null | DateRangeInitial value when uncontrolled.
onValueChange(value: Date | null) => void | (value: DateRange) => voidCalled with the new value when it changes.
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6
minDateDate
maxDateDate
isDateDisabled(date: Date) => boolean
monthDateFirst visible month (controlled).
defaultMonthDateInitial month when uncontrolled.
onMonthChange(month: Date) => voidCalled with the new month when it changes.
numberOfMonthsnumberMonths shown side by side.
autoFocusbooleanFocus the active day on mount — used when the calendar opens in a popover.
labelsPartial<CalendarLabels>Accessible names of the month buttons.
childrenReactNodeThe parts of each month, in your order and with your content between them: Calendar.Header (with Calendar.Previous, Calendar.Caption, Calendar.Next) and Calendar.Grid. Default: a header and a grid.

Compound parts

Calendar.Header (CalendarHeader), Calendar.Previous (CalendarPrevious), Calendar.Caption (CalendarCaption), Calendar.Next (CalendarNext), Calendar.Grid (CalendarGrid)

Related components

Previous: Masked Input · Next: Date Picker · All Forms and input