Componentticket-stub0.57 KB gzipZero dependencies

Barcode

Dynamic SVG barcode with mono serial readout.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add barcode

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Barcode } from "@/components/ui/barcode"; <Barcode value="BB-90210" height={48} />

Source code

barcode.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxbarcode.tsx72 lines
import * as React from "react";import { cn } from "./lib/utils"; export interface BarcodeProps extends React.HTMLAttributes<HTMLDivElement> {  value: string;  height?: number;  showValue?: boolean;  className?: string;} export function Barcode({  value = "",  height = 48,  showValue = true,  className,  ...props}: BarcodeProps) {  // Deterministic bar widths and gaps generated from the characters

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { Barcode } from "@/components/ui/barcode"; <Barcode />
PropTypeDescription
valuestringControlled value. (Default: "")
heightnumberConfigures height. (Default: 48)
showValuebooleanToggles show value. (Default: true)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.