ValyroUI English version

Date Range Picker

Выбор диапазона дат. Бесплатно, MIT · Формы и ввод › Дата и время

Установка

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

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

Пропсы

PropTypeDefault
valueDateRangeControlled value; use with onValueChange.
defaultValueDateRangeEMPTYInitial value when uncontrolled.
onValueChange(value: DateRange) => voidCalled with the new value when it changes.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
placeholderstring'Pick a date range'Text shown in the trigger (and the confirm footer) while no range is picked.
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6First day of the week in the calendar grids: 0 = Sunday, 1 = Monday (when omitted).
minDateDateEarliest selectable day (time of day ignored); earlier days and presets starting before it are disabled.
maxDateDateLatest selectable day (time of day ignored); later days and presets ending after it are disabled.
isDateDisabled(date: Date) => booleanReturn true to disable a day, e.g. weekends or booked dates. Presets ignore it.
presetsDateRangePreset[]Shortcuts in the sidebar. Defaults to common ranges ending today; pass [] to hide.
confirmbooleanfalseKeep the selection as a draft until Apply; Cancel discards it.
size'sm' | 'md' | 'lg'Trigger height and text size.
invalidbooleanDanger border on the trigger. Also shown after a submit attempt while a required range is missing.
namestringSubmits name[start] and name[end] as YYYY-MM-DD (empty when unset).
requiredbooleanBlocks native form submission while no range is picked.
inlinebooleanfalseKeeps the panel (presets, calendar, Apply / Cancel) open in the page flow under the field instead of in a popover, e.g. in a report sidebar. open, defaultOpen and onOpenChange do not apply, and the panel never takes focus by itself: the field moves focus into it on click or ArrowDown.
labelsPartial<DateRangePickerLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

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

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