Ballmac UI home

Bullet Chart

New

Stephen Few's bullet chart: a bar for the value, a mark for the target, three shades behind for poor, fair and good, and a sentence saying whether the goal was met. Many measures in a small space, server-rendered.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed
  • Revenue

    268of 300

    Quarter to dateClose to target
  • New customers

    131of 120

    Target is 120Target met
  • Net promoter score

    41of 50

    Last 90 daysBehind target
  • 90-day retention

    78of 85

    As a percentageClose to target

Installation

$ pnpm dlx shadcn@latest add @ballmac/bullet-chart

Usage

import { BulletChart, standing } from "@/components/ballmac/bullet-chart"

The full example is in the Code tab above.

Examples

Lower is better

  • Median response time

    142 msof 200 ms

    Lower is betterTarget met
  • 95th percentile

    480 msof 400 ms

    Lower is betterBehind target
  • 99th percentile

    1250 msof 900 ms

    Lower is betterBehind target

API reference

PropTypeDefault
items*BulletItem[]—
format

Turns a value into text.

(value: number) => string(v) => v.toLocaleString("en-US")

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersEach row is a meter reading '84 against a target of 90. Close to target'
WordsThe standing is written ('Behind target') with an icon; the shades and the mark are decoration
Right-to-leftBars and marks start from the right edge

Use with AI

items is [{ id, label, value, target?, max?, ranges?: [poorEnd, fairEnd], note?, lowerIsBetter? }]. format(value). Each item reads as a meter and says Target met, Close to target (within 85%) or Behind target. No client code: it renders on the server. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Bullet Chart (@ballmac/bullet-chart) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Comparing several measures to their goals in a small space
  • KPIs, SLAs and budgets where the target matters more than the trend

Not for

  • A single value with no goal; use progress
  • A trend; use sparkline or chart-line
  • Proportions of a whole; use treemap or chart-pie

Registry JSON: https://ui.ballmac.com/r/bullet-chart.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.