Barcode
A zero-dependency SVG barcode renderer supporting CODE128 (auto B/C) and EAN13 formats with optional human-readable text.
Preview
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | string | — | The value to encode as a barcode |
format | string | code128 | Barcode format: "code128" or "ean13" |
height | number | 80 | Bar height in px |
displayValue | boolean | — | Show human-readable text under the bars |
Installation
pura is copy-paste and dependency-free. Load the whole library, or just this component.
<link rel="stylesheet" href="/pura/tokens.css">
<script type="module" src="/pura/lib/barcode.js"></script> import "./pura/lib/barcode.js";