Componentticket-stub0.57 KB gzipZero dependencies
Barcode
Dynamic SVG barcode with mono serial readout.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add barcodeOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Barcode } from "@/components/ui/barcode"; <Barcode value="BB-90210" height={48} />Source code
barcode.tsx + 1 helperZero 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 charactersProps
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Barcode } from "@/components/ui/barcode"; <Barcode />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. (Default: "") |
| height | number | Configures height. (Default: 48) |
| showValue | boolean | Toggles show value. (Default: true) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |