ValyroUI English version

Date Field

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

Установка

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

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

Пропсы

PropTypeDefault
valueDate | nullControlled value; use with onValueChange.
defaultValueDate | nullnullInitial value when uncontrolled.
onValueChange(value: Date | null) => voidCalled with the date once every segment is filled, and with null when one is cleared.
localestringOrder of day, month and year, the separators and the digits. Defaults to the ThemeProvider locale, then the browser's.
minDateDateEarliest valid day (time of day ignored): an earlier date marks the field invalid.
maxDateDateLatest valid day (time of day ignored): a later date marks the field invalid.
size'sm' | 'md' | 'lg''md'Field height and text size.
disabledbooleanfalseTakes the segments out of the Tab order and leaves the date out of form data.
readOnlybooleanfalseFocusable and readable, not editable.
invalidbooleanfalseDanger border and aria-invalid. Also shown after a submit attempt while a required date is missing.
namestringSubmits the date with the surrounding form as YYYY-MM-DD (empty when incomplete).
requiredbooleanBlocks native form submission while the date is incomplete; aria-required on the segments.
iconReactNode<CalendarIcon />Icon before the segments; null for none. Default: a calendar.
labelsPartial<DateFieldLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

  • Date Picker — Выбор даты
  • Date Range Picker — Выбор диапазона дат
  • 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 Range Picker · Далее: Time Picker · Весь раздел «Формы и ввод»