Componentpickers0.87 KB gzipZero dependencies
Duration Input
Duration input: hour/minute/second steppers.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add duration-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { DurationInput } from "@/components/ui/duration-input"; <DurationInput />Source code
duration-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxduration-input.tsx70 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface DurationValue { hours: number; minutes: number; seconds?: number;} export interface DurationInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> { value?: DurationValue; defaultValue?: DurationValue; onValueChange?: (value: DurationValue) => void; showSeconds?: boolean; label?: string;}Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { DurationInput } from "@/components/ui/duration-input"; <DurationInput />| Prop | Type | Description |
|---|---|---|
| value | DurationValue | Controlled value. |
| defaultValue | DurationValue | Initial value when uncontrolled. (Default: { hours: 0, minutes: 0 }) |
| onValueChange | (value: DurationValue) => void | Callback invoked on value change. |
| showSeconds | boolean | Toggles show seconds. (Default: false) |
| label | string | Accessible label text rendered or attached to the control. (Default: "Duration") |