Progress Chart
Progress chart for quotas and goals: meters, a segmented bar and a waffle.
Playground
Installation
Progress Chart comes with WunderUI Core and Pro, in the package from your plan. See the plans.
The charts live in their own entry point: import the chart, its card and its hooks from @wunderui/react/charts, not from @wunderui/react.
Then import what you need:
import {
ProgressChart,
ProgressChartProps,
ProgressChartVariant,
} from "@wunderui/react/charts"Then use it:
import { ProgressChart } from "@wunderui/react/charts"
const data = [
{ name: "API requests", value: 72 },
{ name: "Storage", value: 48 },
{ name: "Seats", value: 90 },
]
export function PlanUsage() {
return <ProgressChart data={data} index="name" max={100} label="Plan usage" />
}Expected result: You should see three bars filled to 72, 48 and 90 percent, each with its name.
When to use
Use Progress Chart for
- Usage against a quota: requests, storage, seats
- Completion of several tasks or goals
- One bar split into parts (segmented), or a single percentage as a waffle
Use something else for
- Radial Chart for progress as rings
- Gauge Chart for one value on a scale with bands
- Bullet Chart for a measure against a target and ranges
- Progress for a single progress bar inside a form or a card
States
Loading, empty and error keep the chart's size, so the card never jumps. Add a retry handler and the error state offers a Try again button.
Keyboard interactions
The plot is focusable: Arrow keys step through the rows or segments and the live region announces the name and progress, not a share of the total.
- TaborShiftTab
- Moves focus to the plot and away from it. The plot is one tab stop; so is every legend badge.
- ArrowRightorArrowLeft
- Moves to the next or previous row. The tooltip follows, and a live region announces the one you are on. The first press starts at the first one (Left: the last one).
- HomeorEnd
- Jumps to the first or last row.
- Escape
- Clears the active point.
- EnterorSpace
- On a legend badge of a ChartCard: switches its series off or on. The last visible series stays on.
Behavior and motion
What the chart does on its own and what the page decides.
- Against max
- The max is the value of a full bar, or of the whole waffle (default 100). Without a formatter the values read as a percent of the max.
- Variants
- A meter is a track with a fill and a label per row, and the segmented variant is one bar split into the rows' shares. The waffle fills 100 cells in reading order and adds up to exactly 100.
- Announcement
- The live region reads Direct: 42%, or 42 GB of 100 GB with a custom formatter.
- Loading, empty and error
- The chart keeps its size while loading, empty or failed, so the card never changes height. Add a retry handler to show a Try again button on error.
- Legend
- In a ChartCard, each series badge is a button that switches its series off, but the last visible series stays on. A legend of roles can be made static.
- Data table
- The chart renders its data as a table for screen readers, in the same order as the plot.
- Size
- The chart fills the width of its container and you set the plot height. Text never scales, so labels keep their size at every width.
Motion
The enter sequence and the hover follow the motion tokens of the library.
- Fill
- Bars grow in from the left and waffle cells fill in reading order when the chart first comes into view, after loading and when new data arrives. The animation can be turned off.
- Reduced motion
- With reduced motion on, the chart appears at once without the enter sequence. The tooltip and every state still work.
Anatomy
ProgressChart shows completion: meters with one bar per row, a segmented bar where rows are parts of one bar, and a 10 by 10 waffle where each cell is one percent. Bars grow in from the left.
Plan usage
| name | Value |
|---|---|
| API requests | 72% |
| Storage | 48% |
| Seats | 90% |
| Build minutes | 31% |
Pass the data with the field names for the row name and the value. The max is the value of a full bar or the whole waffle (default 100), and without a formatter values read as percent of max.
- data-slot="chart-plot"
The focusable region. Arrow keys step through the rows or segments and announce the name and progress, such as Direct: 42%, not a share of the total.
- data-slot="chart-marks"
Meters are a track with a fill and a label row, and the segmented variant is one bar split into the rows' shares. The waffle fills 100 cells, rounded to add up to exactly 100.
- data-slot="chart-tooltip"
The row name with its progress as a percentage of the max.
- data-slot="chart-message"
Five muted tracks under the shimmer. The error title defaults to The chart could not be loaded.
A table of the rows and values for screen readers.
Best practices
- Do
Use the meter when each row has its own target, and the segmented bar when rows are parts of one total, such as storage by file type.
- Do
Show the value in text next to each bar. A fill length without a number cannot be compared between rows.
- Do
Use the waffle for one proportion that you want people to count, for example 37 of 100 customers. Keep it to three or four colours.
- Don’t
Don't use a full bar for something that cannot be completed, such as a revenue figure. A bar suggests an end that does not exist.
- Don’t
Don't show a bar over 100 percent as full without saying so. The fill stops at the max; put the overshoot in the label.
API reference
One table for ProgressChart, listing every prop. A ChartCard around it takes its own props, and the chart works without one.
Pass the data with the field names for the row name and the value. The max is the value of a full bar or the whole waffle (default 100), and without a formatter values read as percent of max.
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("progress-chart")The full library index for assistants is at /llms.txt.