Components
Loading preview...
A time field allows users to enter and edit time values using a keyboard. Each part of a time value is displayed in an individually editable segment. A time field can be built using <input type="time">, but this is very limited in functionality, lacking in internationalization capabilities, inconsistent between browsers, and difficult to style. TimeField helps achieve accessible and international time fields that can be styled as needed.
@jolbol1
npx shadcn@latest add https://21st.dev/r/jolbol1/timefieldimport { DateInput, TimeField } from "@/components/ui/timefield"
import { Label } from "@/components/ui/field"
export function TimeFieldDemo() {
return (
<TimeField className="space-y-1">
<Label>Event time</Label>
<DateInput className={"min-w-[100px]"} />
</TimeField>
)
}