Barcode
Renders a 1D Code 128B barcode as inline SVG. Suitable for product labels, order numbers, and any ASCII printable data.
Installation
dotnet add package Lumeo
One-time app setup (AddLumeo(), CSS & JS) is covered in the
installation guide.
Usage
@using Lumeo <Barcode />
When to Use
- Display a scannable 1D barcode for inventory, shipping, or order reference numbers.
- Embed barcodes in printable reports or labels without external dependencies.
- Use alongside QRCode when 2D scanning is not available.
Height: 80 px
BarWidth: 2
Adjust height and bar width to preview the barcode at different sizes.
Implementation Note
This component implements a real Code 128B encoder in C# (Code Set B, ASCII 32–126). Barcodes rendered by this component are scannable by standard 1D barcode readers. Only printable ASCII characters (space through tilde) are supported; characters outside this range will cause the barcode to render blank.
API Reference
Barcode
| Property | Type | Default | Description |
|---|---|---|---|
| Value | string | "" | Data to encode. Supports ASCII 32–126 (printable characters). |
| Format | BarcodeFormat | Code128 | Barcode format: Code128 (Code Set B), Code39 (43-char set, lowercase normalized to uppercase, no check digit), or EAN13 (12 digits + computed check digit, or 13 digits with the check digit validated). Invalid input renders a small error message instead of bars. |
| Height | int | 80 | Bar height in pixels. |
| BarWidth | double | 2 | Width per narrow module in pixels. Increase for larger barcodes. |
| ShowText | bool | true | Render the value as text below the bars. |
| Color | string | "foreground" | Theme token for the bar color. |
| BackgroundColor | string | "background" | Theme token for the background fill. |
Related Components
- QRCode — 2D QR barcode with error correction and optional centre image.