Componentpickers0.83 KB gzipZero dependencies

Masked Input

Formatted code field with auto-formatted delimiters and validation mark.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add masked-input

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { MaskedInput } from "@/components/ui/masked-input"; <MaskedInput mask="BB-####-####" defaultValue="BB-2026-0001" />

Source code

masked-input.tsx + 1 helper

Zero 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 />
PropTypeDescription
maskstringConfigures mask. (Default: "BB-####-####")
valuestringControlled value.
defaultValuestringInitial value when uncontrolled. (Default: "")
onValueChange(val: string, complete: boolean) => voidCallback invoked on value change.
classNamestringOptional Tailwind or custom CSS classes merged with component styles.