ValyroUI English version

Calendar

Встроенная сетка месяца: дата или диапазон, несколько месяцев, недоступные дни, своё содержимое дня. Бесплатно, MIT · Формы и ввод › Дата и время

Установка

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';

Пропсы

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.

Составные части

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

Похожие компоненты

  • Date Picker — Выбор даты
  • Date Range Picker — Выбор диапазона дат
  • Date Field — Ввод даты по сегментам в порядке локали
  • Time Picker — Выбор времени
  • Time Field — Ввод времени по сегментам, 24 часа или AM/PM
  • Wheel Picker — Барабан выбора в стиле iOS: инерция, 3D-цилиндр, пресеты даты и времени
  • Date Of Birth Input — Дата рождения тремя списками в порядке локали
  • Text Input — Текстовые поля
  • Input Group — Поле вместе с текстом, кнопками и списками в одной рамке
  • Textarea — Многострочный ввод
  • Search Input — Поисковая строка
  • Mentions Input — Текст с @упоминаниями и #тегами, асинхронные подсказки

Назад: Masked Input · Далее: Date Picker · Весь раздел «Формы и ввод»