A compact card of progress rings, with a stat for each ring. Point at a ring or a stat to bring it forward; a ring past its goal laps the start.
Used for
- A daily or weekly goals card on a dashboard
- A team's targets in one glance
- Progress against a few quotas that use different units
Examples
Day
Installation
npx knowns-ui@latest add goal-ringsFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Goal rings from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/goal-rings
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add goal-rings
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/animated-number.tsx
- components/ui/knowns/card.tsx
- components/ui/knowns/chart/chart.tsx
- components/ui/knowns/chart/chart-utils.ts
- components/ui/knowns/chart/sparkline.tsx
- components/ui/knowns/chart/chart-radial.tsx
- components/ui/knowns/blocks/analytics/goal-rings.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/goal-rings, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "goal-rings" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- title / description / action
ReactNode- The card header. Action sits at the end, for a period switch.
- goals
{ label, value, goal, unit?, color? }[]- One ring and one stat each, the first outermost. Progress is value over goal; past it the ring laps, up to three laps.
- center / centerLabel
"total"|ReactNode|false / string- Default
"total" / "Overall" - The figure in the hole. "total" is the mean of each ring's progress, capped at 100% per ring.
- size
number- Default
184 - Diameter of the rings in px.
- onSelect
(index, goal) => void- Makes the rings and the stats pressable.
| Prop | Type | Default | Description |
|---|---|---|---|
| title / description / action | ReactNode | - | The card header. Action sits at the end, for a period switch. |
| goals | { label, value, goal, unit?, color? }[] | - | One ring and one stat each, the first outermost. Progress is value over goal; past it the ring laps, up to three laps. |
| center / centerLabel | "total" | ReactNode | false / string | "total" / "Overall" | The figure in the hole. "total" is the mean of each ring's progress, capped at 100% per ring. |
| size | number | 184 | Diameter of the rings in px. |
| onSelect | (index, goal) => void | - | Makes the rings and the stats pressable. |
What it handles
- 01Draws one ring per goal with the Chart rings type, the first outermost, each with a faint track in its own colour.
- 02Lists a stat for each ring beside it: swatch, label, value, goal and percent. Below about 360px wide the stats go under the rings.
- 03Pointing at or focusing a ring, or its stat, brings that ring forward and dims the others. The matching stat highlights too.
- 04Laps the start when a goal is beaten, with a soft shadow on the arc's end, and writes the mean progress in the hole with each ring capped at 100%.
- 05Reaches every ring by keyboard: arrow keys read a ring, Tab reaches the stats, and each stat says its value, goal and percent to screen readers.
States
- First render
- Nothing. The rings paint their final state
- none
- Value changes
- Each arc sweeps from its old length to the new one
- 280ms, ease in-out
- Ring or stat in focus
- The other rings and stats drop to low opacity, the stat gets a tint
- 120ms, ease out
- Reduced motion
- Every change lands at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The rings paint their final state | none |
| Value changes | Each arc sweeps from its old length to the new one | 280ms, ease in-out |
| Ring or stat in focus | The other rings and stats drop to low opacity, the stat gets a tint | 120ms, ease out |
| Reduced motion | Every change lands at once | 0ms |
Works with
When to use
When to use
- A goals card on a dashboard: a few measures, each against its own target, in one glance.
- Quotas in different units (runs, minutes, deploys) that should read as one set.
When not to use
- One value against one limit: use Progress.
- A trend over time: use Chart.
- Many goals: a table reads better past five: use Data Table.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Goal Rings to my app and wire it to my own data.
- I need a goals card on a dashboard: a few measures, each against its own target, in one glance. Set that up with the Knowns UI Goal Rings.
- Which Goal Rings props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "goal-rings" }) and search_docs({ query: "goal rings" }).