Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-barcode>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Zero-dependency deterministic ISO/IEC 15417 Code 128B SVG barcode generator with accessible label and optional caption.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-barcode> (@methane-ui/ui)
Ready · interact with <mth-barcode>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/barcode"></script>
<mth-barcode height="56" show-value></mth-barcode>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""ASCII text encoded as Code 128B bars.
labellabelstring""Accessible alternative text describing the barcode.
heightheightnumber56Bar block height in SVG user units/CSS pixels.
showValueshow-valuebooleantrueDisplays the human-readable encoded string beneath the bars.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
i18nRoutes 2 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test