Componentpickers0.83 KB gzipZero dependencies
Masked Input
Formatted code field with auto-formatted delimiters and validation mark.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add masked-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { MaskedInput } from "@/components/ui/masked-input"; <MaskedInput mask="BB-####-####" defaultValue="BB-2026-0001" />Source code
masked-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxmasked-input.tsx99 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface MaskedInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> { mask?: string; // e.g. "BB-####-####" where # represents digits, A represents alpha value?: string; defaultValue?: string; onValueChange?: (val: string, complete: boolean) => void; className?: string;} export function MaskedInput({ mask = "BB-####-####", value: controlledValue, defaultValue = "",Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { MaskedInput } from "@/components/ui/masked-input"; <MaskedInput />| Prop | Type | Description |
|---|---|---|
| mask | string | Configures mask. (Default: "BB-####-####") |
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onValueChange | (val: string, complete: boolean) => void | Callback invoked on value change. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |