A place in the day
Studio visit
The browser handles local time formatting and keyboard editing.
Edits a time using the platform's localized time control with native bounds and second-based steps.
Studio visit
The browser handles local time formatting and keyboard editing.
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { TimeField } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/time-field.
npx @noorddev/vlak-cli add time-field
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/time-field.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { TimeField } from "@noorddev/vlak-react";
<TimeField label="Start time" name="start-time" defaultValue="09:30" min="09:00" max="18:00" step={900} hint="Appointments start every 15 minutes" />The platform time editor, including its locale, keyboard and step validation.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | A 24-hour HTML time value, HH:mm or HH:mm:ss. The browser localizes editing. | |
defaultValue | string | "" | |
onValueChange | (value: string) => void | ||
label | ReactNode | ||
hint | ReactNode | ||
error | ReactNode |
Also accepts Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange">.
| Keys | Does |
|---|---|
| Tab, arrow keys | Uses the browser's time segment navigation and native stepping. |
| Typing | Edits the active hour, minute, or second segment according to the platform. |
<label>Start time<input class="rs-input rs-time-field" type="time" name="start-time" value="09:30" min="09:00" max="18:00" step="900" /></label>