About
A React time picker component that allows users to select a time value. Used in forms to choose hours and minutes through an accessible time input.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Time Picker to your project and fits it to your theme.
Code
How Time Picker is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client"
import { FieldDescription, TimePicker, TimePickerTrigger, buttonVariants } from "@/components/ui/tailgrids-time-picker"
import { useState } from "react"
import { useDateFormatter } from "react-aria"
export default function TimePickerPreview() {
const [selectedTime, setSelectedTime] = useState<Date | null>(null);
const formatter = useDateFormatter({ timeStyle: "short" });
return (
<div className="flex w-full flex-col items-center gap-6 p-4">
<div className="w-full max-w-xs">
<TimePicker onSelect={setSelectedTime}>
<TimePickerTrigger
className={buttonVariants({
appearance: "outline",
className: "w-full justify-start"
})}
>
{selectedTime ? formatter.format(selectedTime) : "Select Time"}
</TimePickerTrigger>
</TimePicker>
{selectedTime && (
<FieldDescription className="mt-4 text-sm">
Selected: {formatter.format(selectedTime)}
</FieldDescription>
)}
</div>
</div>
);
}
















