Componentpickers1.05 KB gzipZero dependencies
Serial Input
Serial number input: grouped boxes, auto-advance, paste support.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add serial-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SerialInput } from "@/components/ui/serial-input"; <SerialInput />Source code
serial-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxserial-input.tsx122 lines
"use client"; import * as React from "react";import { cn, escapeRegExp } from "./lib/utils"; export interface SerialInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> { groups?: number; groupLength?: number; value?: string; defaultValue?: string; onValueChange?: (value: string) => void; onComplete?: (value: string) => void; separator?: string;} /** Serial license input: grouped slots, auto-advance, clipboard paste. */export function SerialInput({ groups = 3,Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { SerialInput } from "@/components/ui/serial-input"; <SerialInput />| Prop | Type | Description |
|---|---|---|
| groups | number | Configures groups. (Default: 3) |
| groupLength | number | Configures group length. (Default: 4) |
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onValueChange | (value: string) => void | Callback invoked on value change. |
| onComplete | (value: string) => void | Callback invoked on complete. |
| separator | string | Configures separator. (Default: "-") |