Category bar

A React component in Beamline's Dashboard category.

One bar split into labelled ranges with an optional marker that names its range.

Use it for

  • Where a value sits in bands (score, health)
  • A small budget split.

Not for

  • Many categories or exact comparison → bar-list.

Anatomy

  • root (a size container)
  • marker label (value · range; its anchor slides from its start edge to its end edge, so it stays over the bar)
  • segments
  • marker (travels on the compositor)
  • boundary ticks (an inner tick that would touch its neighbour hides)
  • legend (swatch, name and share of the bar; the share rolls)

Variants

  • showBoundaries: on, off
  • legend: on, off

States

  • with marker
  • without
  • pointed range: the range under the pointer, on the bar or in the legend, comes forward in both; the others step back at once and return over --pui-motion-out
  • loading (`loading`: the bar, boundary row and legend line as placeholders of their real height)

Keyboard

  • Presentational; role=img with a full text description.

Motion

Segments ease to new shares over --pui-duration-standard; the legend's shares roll (SlotText); the marker and its label travel to a new value on the compositor over the same duration. Pointing at a range dims the others at once. Reduced motion: shares, widths and the marker change at once.

Props

PropTypeDefaultDescription
segments (required){ label, value, color? }[]—Labelled segments in display order. Required.
marker{ value, label? }—A value on the same scale to point at, e.g. the current score.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
classNamesCategoryBarClassNames—Classes for the named visual parts; no part overrides by default.
loadingbooleanfalseWhile the split loads: the bar, its boundary row and legend line as placeholders of their real height.
showBoundariesboolean—Tick labels at segment boundaries.
legendboolean—Shows labels and colour keys for the data. Defaults to false.
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.

Built from

Used in

Import

import { CategoryBar } from "@beamline/category-bar";

Get it

Category bar is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Dashboard

  • Explainable total: A total that answers "why this much?" in place: it unfolds into the steps that made it — a waterfall whose bars start where the last step ended, each…
  • Explainable change: A metric whose change explains itself: at rest the value, the change against a named period and a thin ribbon of its causes under the change; opened in…
  • Budget vessels: Budgets as glasses of money: the liquid is what is left (free money on top, committed money as a lighter layer under it), the lip at the period's budget…
  • Insight cards: Findings from an agent, one per page: the sentence, the series it is about with their change, a chart to scrub that names each point, and a follow-up…
  • Tracker: A row of status blocks for uptime, job runs or daily checks, with tooltips and a legend.
  • Metric card: A KPI that fills its tile: label, a value that rolls to each new number, the change with arrow, sign and tone, what it compares with and the value it…
  • Bar list: Ranked horizontal bars, label and value over a meter, one line per row when there is room — top pages, sources, customers.
  • App shell: The frame for every app screen: collapsible sidebar with grouped navigation, top bar and page.

Guides: Build an analytics dashboard in React

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.