One 0 to 100 score for an AI eval, made of weighted sub-scores: a rounded gauge, a rating, a stepper between runs and a row for each sub-score. Point at a row or a segment to bring it forward.
Used for
- An eval report for a model or an agent
- A score made of weighted parts
- Comparing the last few runs of one eval
Examples
Shape
Installation
npx knowns-ui@latest add eval-scoreFor 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 Eval score 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/eval-score
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 eval-score
```
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/spinner.tsx
- components/ui/knowns/button.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/eval-score.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
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/eval-score, 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: "eval-score" }) 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
ReactNode- The card header.
- runs
{ label, date?, criteria }[]- Runs, oldest first; the latest shows first. Each criterion is { label, note?, score, max, color? }. The segment's length is its max.
- run / defaultRun / onRunChange
number / number / (index) => void- Default
latest - Control the shown run from outside, or just listen.
- ratings
{ min, label }[]- Default
90 Excellent, 75 Good, 50 Fair, 0 Needs work - The label is the one with the highest min the score reaches.
- shape
"arc"|"ring"- Default
"arc" - A half circle or a full ring.
- rounded
boolean- Default
true - Round the ends of the segments.
- size
number- Default
320 - The gauge's width in px, at most; it shrinks with the card.
- onSelect
(index, criterion) => void- Makes the segments and rows pressable.
| Prop | Type | Default | Description |
|---|---|---|---|
| title / description | ReactNode | - | The card header. |
| runs | { label, date?, criteria }[] | - | Runs, oldest first; the latest shows first. Each criterion is { label, note?, score, max, color? }. The segment's length is its max. |
| run / defaultRun / onRunChange | number / number / (index) => void | latest | Control the shown run from outside, or just listen. |
| ratings | { min, label }[] | 90 Excellent, 75 Good, 50 Fair, 0 Needs work | The label is the one with the highest min the score reaches. |
| shape | "arc" | "ring" | "arc" | A half circle or a full ring. |
| rounded | boolean | true | Round the ends of the segments. |
| size | number | 320 | The gauge's width in px, at most; it shrinks with the card. |
| onSelect | (index, criterion) => void | - | Makes the segments and rows pressable. |
What it handles
- 01Turns the sub-scores into one 0 to 100 score: points earned over points available. A segment's length is its max, so the weights are the maxes.
- 02Draws each segment with rounded ends and a faint track in its own colour, the earned part filling it, on a half arc or a full ring.
- 03Writes the rating from the thresholds you pass: the label with the highest minimum the score reaches.
- 04Steps between runs with previous and next buttons; the arcs, bars and numbers ease to the new run together.
- 05Pointing at or focusing a row or a segment dims the others, like Goal rings. Every row is a button that says its score, its max and its note to screen readers.
States
- First render
- Nothing. The gauge paints its final state
- none
- Run changes
- Segments, bars and the score ease to the new run
- 280ms, ease in-out
- Rating changes
- The label settles in with a 4px rise
- 180ms, ease out
- Row or segment in focus
- The others drop to low opacity
- 120ms, ease out
- Reduced motion
- Every change lands at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The gauge paints its final state | none |
| Run changes | Segments, bars and the score ease to the new run | 280ms, ease in-out |
| Rating changes | The label settles in with a 4px rise | 180ms, ease out |
| Row or segment in focus | The others drop to low opacity | 120ms, ease out |
| Reduced motion | Every change lands at once | 0ms |
Works with
When to use
When to use
- The result of an eval run: one score from weighted parts, with the parts under it.
- Showing whether the last run beat the one before.
When not to use
- Goals in different units: rings read better: use Goal Rings.
- A trend over many runs: use Chart.
- One value against one limit: use Progress.
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 Eval Score to my app and wire it to my own data.
- I need the result of an eval run: one score from weighted parts, with the parts under it. Set that up with the Knowns UI Eval Score.
- Which Eval Score props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "eval-score" }) and search_docs({ query: "eval score" }).