ValyroUI English version

Time Picker

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

Установка

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

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

Пропсы

PropTypeDefault
valuestring | null24-hour "HH:mm" string.
defaultValuestring | nullnullInitial value when uncontrolled.
onValueChange(value: string | null) => 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.
hourCycle12 | 24Display and pick in 12-hour (AM/PM) or 24-hour format; defaults to the locale's clock. The value is always 24-hour.
minuteStepnumber5Minutes between options in the minute column.
placeholderstring'Pick a time'Text shown in the trigger while no time is picked.
localestringLocale for digits and AM/PM names. Defaults to the ThemeProvider locale, then the browser's.
size'sm' | 'md' | 'lg'Trigger height and text size.
invalidbooleanDanger border on the trigger. Also shown after a submit attempt while a required time is missing.
namestringSubmits the time with the surrounding form as 24-hour HH:mm (empty when unset).
requiredbooleanBlocks native form submission while no time is picked.
inlinebooleanfalseKeeps the columns open in the page flow under the field instead of in a popover (a settings page, a showcase). open, defaultOpen and onOpenChange do not apply, and the columns never take focus by themselves: the field moves focus into them on click or ArrowDown.
labelsPartial<TimePickerLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

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

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