Componentpickers0.94 KB gzipZero dependencies
Pin Input
Segmented single-character boxes for codes and OTP.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add pin-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { PinInput } from "@/components/ui/pin-input"; <PinInput length={4} onComplete={(pin) => console.log(pin)} />Source code
pin-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxpin-input.tsx121 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface PinInputProps { length?: number; value?: string; defaultValue?: string; onValueChange?: (value: string) => void; onComplete?: (value: string) => void; disabled?: boolean; className?: string; "aria-label"?: string;} export const PinInput = React.forwardRef<HTMLDivElement, PinInputProps>(function PinInput( {Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { PinInput } from "@/components/ui/pin-input"; <PinInput />| Prop | Type | Description |
|---|---|---|
| length | number | Configures 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. |
| disabled | boolean | Disables interaction and applies disabled styling. (Default: false) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |
| aria-label | string | Configures aria label. |