Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Charts
  4. BulletChart

ChartsAlea Pro

BulletChart

Actual against a target over poor, fair and good ranges: many KPIs in little space.

import { BulletChart } from '@alea/pro';

Examples

KPIs against targets

The bar is the actual, the line the target, the shades poor, fair and good.

Quarter KPIs

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-focus…
  • --alea-surface-raised…
  • --alea-text…
  • --alea-text-muted…

Space

  • --alea-space-3…

Type

  • --alea-font-size-md…
  • --alea-font-weight-semibold…

Motion

  • --alea-motion-duration-slower…
  • --alea-motion-spring…

Component

  • --alea-chart-1…

Props

BulletChart props

Actual against a target, over qualitative ranges (Stephen Few): many KPIs in little space.

PropTypeDefaultDescription
datarequired{ label: string; value: number; target?: number | undefined; ranges?: number[] | undefined; max?: number | undefined; }[]-One row per measure: the actual value, a target, and ranges (poor, fair, good) as upper bounds.
classNamestring-Extra class names for the root element.
descriptionReactNode-One sentence on what the data shows; read before the chart.
isLoadingboolean-Shows a shimmering placeholder while data loads.
showTablebooleantrueShows the table toggle. Default true.
titleReactNode-The title shown above it and read by screen readers.
valueFormat((v: number) => string)-Formats values (axis, tooltip, table).

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

States
Keyboard focusPressed (CSS)
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-bullets.alea-bullet.alea-bullet-label.alea-bullet-track.alea-bullet-range.alea-bullet-value.alea-bullet-target.alea-bullet-num

Accessibility

  • The chart is a figure named by its title and described by its description; the picture has a text summary.
  • Tab to the chart, then arrow keys move through the data and each value is announced; Escape leaves.
  • The table toggle shows the same data as a real table for everyone who can't use the picture.

Keyboard

KeyDoes
TabFocuses the chart
Left or Right arrowPrevious or next value
Home or EndFirst or last value
EscapeClears the selection

Do and don't

Do

  • Use it for many KPIs in a list or a dashboard.
  • Name the ranges in the description so the colors aren't the only clue.

Don't

  • Don't use it without a target: a progress bar is simpler.
Tested with axe, keyboard and screen reader roles