BulletChart

Progress against a goal. The bar fills on a spring, a tick marks the target, and rows that beat it turn solid. Charts.

Open playground
Revenue$84k / $70k
Pipeline$52k / $80k
Renewals$91k / $90k

About

BulletChart is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { BulletChart } from "@ashutoshswamy/smoui" and set data, prefix.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { BulletChart } from "@ashutoshswamy/smoui";

<BulletChart data={[{ label: "Revenue", value: 84, target: 70 }, { label: "Pipeline", value: 52, target: 80 }]} />

Props 2

data

One row each. `max` is the full track.

{ label; value; target; max? }[]
prefix / suffix

Wrap values, or pass `format`.

string