Barcode
Encode any string as a 1D barcode and render it as inline SVG.
Basic Usage
Default Barcode
Pick a format, type your value, and scan with a barcode reader app on your phone to verify. Invalid inputs render an inline error.
<Barcode value="FLUXO-UI-2026" format="CODE128" />Formats
Supported Formats
Six 1D symbologies cover almost every use case.
<Barcode format="CODE128" value="FLUXO-UI-2026" />
<Barcode format="EAN13" value="4006381333931" />Customization
Visual Customization
Tune bar width, height, color, margin, and the human-readable text below.
<Barcode
value="HELLO"
format="CODE39"
width={3}
height={100}
foreground="#3b82f6"
background="var(--eui-bg)"
fontSize={16}
displayValue
/>Import
import { Barcode } from 'fluxo-ui';
import type { BarcodeProps, BarcodeFormat } from 'fluxo-ui';Props
valuereqstringValue to encode (numeric for EAN/UPC/ITF, alphanumeric for CODE39/CODE128)
valuereqstringValue to encode (numeric for EAN/UPC/ITF, alphanumeric for CODE39/CODE128)
formatreq'CODE128' | 'CODE39' | 'EAN13' | 'EAN8' | 'UPC' | 'ITF'Barcode symbology
formatreq'CODE128' | 'CODE39' | 'EAN13' | 'EAN8' | 'UPC' | 'ITF'Barcode symbology
widthnumber"2"Width of the narrowest bar in px
widthnumber"2"Width of the narrowest bar in px
heightnumber"80"Bar height in px
heightnumber"80"Bar height in px
displayValueboolean"true"Show the human-readable text below the bars
displayValueboolean"true"Show the human-readable text below the bars
fontstring"'inherit'"Font family for the human-readable text
fontstring"'inherit'"Font family for the human-readable text
fontSizenumber"14"Font size for the human-readable text
fontSizenumber"14"Font size for the human-readable text
textMarginnumber"6"Vertical gap between bars and text
textMarginnumber"6"Vertical gap between bars and text
foregroundstring"'#000000'"Bar and text color. Default is black for maximum scannability — CSS variables that flip with dark mode are NOT recommended (most barcode scanners reject light-on-dark)
foregroundstring"'#000000'"Bar and text color. Default is black for maximum scannability — CSS variables that flip with dark mode are NOT recommended (most barcode scanners reject light-on-dark)
backgroundstring"'#ffffff'"Background color. Default is white for maximum scannability. Use 'transparent' to omit
backgroundstring"'#ffffff'"Background color. Default is white for maximum scannability. Use 'transparent' to omit
marginnumber"10"Quiet zone in px on each side
marginnumber"10"Quiet zone in px on each side
onError(err: Error) => voidFired when input is invalid for the chosen format
onError(err: Error) => voidFired when input is invalid for the chosen format
idstringHTML id attribute
idstringHTML id attribute
classNamestringAdditional CSS classes
classNamestringAdditional CSS classes
altstringAccessible label override
altstringAccessible label override
Features
6 Symbologies
CODE128, CODE39, EAN13, EAN8, UPC, ITF — covering retail, logistics, and general use cases.
Built-in Validation
Each format validates input and surfaces an inline error via onError; checksums are computed automatically.
Inline SVG
Renders crisp at any zoom. Foreground/background accept any CSS color including theme variables.