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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
value | string | null | 24-hour "HH:mm" string. | |
defaultValue | string | null | null | Initial value when uncontrolled. |
onValueChange | (value: string | null) => void | Called with the new value when it changes. | |
open | boolean | Controlled open; use with onOpenChange. | |
defaultOpen | boolean | false | Initial open when uncontrolled. |
onOpenChange | (open: boolean) => void | Called with the new open when it changes. | |
hourCycle | 12 | 24 | Display and pick in 12-hour (AM/PM) or 24-hour format; defaults to the locale's clock. The value is always 24-hour. | |
minuteStep | number | 5 | Minutes between options in the minute column. |
placeholder | string | 'Pick a time' | Text shown in the trigger while no time is picked. |
locale | string | Locale for digits and AM/PM names. Defaults to the ThemeProvider locale, then the browser's. | |
size | 'sm' | 'md' | 'lg' | Trigger height and text size. | |
invalid | boolean | Danger border on the trigger. Also shown after a submit attempt while a required time is missing. | |
name | string | Submits the time with the surrounding form as 24-hour HH:mm (empty when unset). | |
required | boolean | Blocks native form submission while no time is picked. | |
inline | boolean | false | Keeps 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. |
labels | Partial<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 · Весь раздел «Формы и ввод»