Block Bar
Unicode block-character bar for displaying proportional values. Supports single-value and multi-segment stacked bars.
Installation
dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
Usage
Examples
Stats
Multi-Segment
API Reference
BlockBar
BlockBar.Segment
Accessibility
Notes
Simple Mode
Single-value bar: <BlockBar label="Errors" value={3} max={45} variant="error" />. Label, bar, and value display are rendered automatically.
Multi-Segment Mode
Pass a segments array: segments={[{ value: 60, variant: 'success' }, { value: 25, variant: 'warning' }]}. Value is derived from the segment sum unless explicitly provided. Cells are allocated across ordered segments, so an exact max-total fills the configured width without clipping later segments. When segments and children are both provided, segments win and define rendering and value. Each segment also accepts className for app-owned colors the built-in variants do not cover.
Compound Mode
Pass BlockBar.Segment children for custom per-segment content (labels, event handlers, tooltips). Cells are allocated across the segment children in order. Root renders the empty background automatically.
Value Text
Set valueText to customize aria-valuetext for app-owned labels such as severity summaries. The visible value remains numeric.
Color Variants
The variant prop accepts: default, muted, error, warning, success, info.
Custom Characters
filledChar (default: █) and emptyChar (default: ░) control the block characters. Individual segments can override with the char prop.
Source
Install via CLI: pnpm exec dgadd add ui/block-bar.
Highlighted source loads after this disclosure opens. Browse the source repository.