Appearance
TimeField
Input time native có style (type=time) cho giờ trong form.
ts
import { TimeField } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import * as React from "react";
import { TimeField } from "@minap/ui";
export function Example() {
const [time, setTime] = React.useState("09:30");
const [nativeTime, setNativeTime] = React.useState("14:00");
return (
<>
<p className="text-xs font-medium text-muted-foreground">Default</p>
<TimeField aria-label="Start time" value={time} onChange={setTime} iconPosition="end" />
<p className="text-sm text-muted-foreground">Value: {time || "—"}</p>
<p className="mt-3 text-xs font-medium text-muted-foreground">Native (OS)</p>
<TimeField
aria-label="End time (native)"
value={nativeTime}
onChange={setNativeTime}
control="native"
iconPosition="end"
/>
<p className="text-sm text-muted-foreground">Value: {nativeTime || "—"}</p>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
value / onChange | string (HH:mm) | — | Giá trị input native |
iconPosition | "start" | "end" | "end" | Icon tùy chỉnh; ẩn indicator/chevron UA trên native |
control | "auto" | "picker" | "native" | "auto" | Parity API; hiện luôn type=time |
disabled | boolean | false | |
className / id / aria-* | Input props | — | Forward sang Input |
Behavior
- Chrome Input Soft Periwinkle
- Thân thiện FormField
- Ẩn chrome clock UA (native-temporal.css)