Componentpickers0.84 KB gzipZero dependencies
Time Input
Curtain call showtime selector with hours, minutes, and AM/PM stepper.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add time-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { TimeInput } from "@/components/ui/time-input"; <TimeInput defaultValue="20:00" onValueChange={(t) => console.log(t)} />Source code
time-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxtime-input.tsx122 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface TimeInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> { value?: string; // "19:30" or "07:30 PM" defaultValue?: string; onValueChange?: (val: string) => void; format24h?: boolean; className?: string;} export function TimeInput({ value: controlledValue, defaultValue = "19:30", onValueChange, format24h = true,Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { TimeInput } from "@/components/ui/time-input"; <TimeInput />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "19:30") |
| onValueChange | (val: string) => void | Callback invoked on value change. |
| format24h | boolean | Toggles format24h. (Default: true) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |