component
Progress
How far along something is, as a thin bar that fills. Green as it goes, amber or red when it needs a look.
PositiveWarningNegativeimport { Progress } from 'rost/components/progress/Progress'
<Progress value={4210} max={7000} label="Tax set aside for 2026" /> src/components/progress/Progress.tsx
import type { HTMLAttributes } from 'react'
import './progress.css'
export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
/** From 0 to `max`. */
readonly value: number
readonly max?: number
readonly tone?: 'positive' | 'warning' | 'negative'
/** What's progressing. It's the bar's name for screen readers. */
readonly label: string
}
const b = 'rost-progress'
/**
* How far along something is, as a thin bar that fills. A
* `role="progressbar"` with its values set. Built from
* contracts/progress.contract.yaml.
*/
export function Progress({ value, max = 100, tone = 'positive', label, className, ...rest }: ProgressProps) {
const share = Math.min(Math.max(value / (max || 1), 0), 1)
return (
<div
role="progressbar"
aria-label={label}
aria-valuenow={value}
aria-valuemin={0}
aria-valuemax={max}
className={[b, `${b}--tone-${tone}`, className].filter(Boolean).join(' ')}
{...rest}
>
<span className={`${b}__fill`} style={{ width: `${share * 100}%` }} />
</div>
)
}
The source for everything on this page: contracts/progress.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: progress
name: Progress
kind: component
status: review
summary: How far along something is, as a thin bar that fills. Green as it goes, amber or red when it needs a look.
category: feedback
related: [ skeleton, inline-banner, badge ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "733:172"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=733-172
extractedAt: "2026-11-16"
extractedBy: hand
frozenAt: "2026-11-16"
props:
value: { type: number, required: true, notes: "From 0 to `max`." }
max: { type: number, default: 100 }
tone:
type: enum
values: [ positive, warning, negative ]
default: positive
notes: "`warning` when it's close to a limit, `negative` when it's over or something failed. Say why in words too."
label: { type: string, required: true, notes: "What's progressing. It's the bar's accessible name." }
elements:
root:
notes: "A `<div role=\"progressbar\">` with `aria-valuenow`, `aria-valuemin` and `aria-valuemax`. It is the track: a 4px pill, as wide as its parent."
styles:
display: { value: block, assert: false }
position: { value: relative, assert: false }
overflow: { value: hidden, assert: false }
width: { value: 100%, assert: false }
height: { token: spacing/gap/2xsmall, value: 4px }
border-radius: { token: spacing/radius/full, value: 10000px }
background: { token: progress/track, value: "#3a3a3a" }
fill:
notes: "How far along, as a share of the track's width, set from `value`. It eases to a new value instead of jumping."
styles:
display: { value: block, assert: false }
height: { value: 100%, assert: false }
border-radius: { token: spacing/radius/full, value: 10000px }
transition-property: { value: width, assert: false }
transition-duration: { token: motion/duration/slow, value: 450ms }
transition-timing-function: { token: motion/easing/move, value: "cubic-bezier(0.4, 0, 0.2, 1)" }
reducedMotion:
notes: "It jumps to the new value for someone who asks for less motion."
elements:
fill:
transition-duration: { value: 0s, assert: false }
variants:
- when: { tone: positive }
figmaNode: "733:165"
elements:
fill:
background: { token: progress/fill/positive, value: "#00d669" }
- when: { tone: warning }
figmaNode: "733:167"
elements:
fill:
background: { token: progress/fill/warning, value: "#fda50d" }
- when: { tone: negative }
figmaNode: "733:169"
elements:
fill:
background: { token: progress/fill/negative, value: "#f2705f" }
guidance:
status: proposed
use:
- title: Known progress
text: "Something with a known end: an upload, how much of the year's tax is set aside, steps through a form."
show: tone=positive
- title: Near a limit
text: "`warning` when it's getting close, like 90% of a budget. The words beside it say what the limit is."
show: tone=warning
avoid:
- title: Unknown waits
text: "When you don't know how long it'll take, there's nothing to fill. Show a **Skeleton** of what's coming."
- title: A score
text: "A rating or a level that isn't going anywhere. Write the number."
behaviour: |-
A 4px grey track with the fill on top, as wide as `value` out of `max`. It eases to a new value over 450ms, or jumps there for someone who asks for less motion. Write the number or the words next to it too: a thin bar is hard to read exactly.
accessibility:
element: "`<div role=\"progressbar\">` with `aria-valuenow`, `aria-valuemin=\"0\"` and `aria-valuemax`. Progress sets them."
name: "`label`, as `aria-label`."
colour: "The fill is a graphic that carries meaning, so it needs 3:1 against the track. The tone is never the only signal: say \"over budget\" in words."
content: "The label says what it measures: \"Tax set aside for 2026\", not \"Progress\"."
Install
npx github:Runceanu/rost add progress It lands in src/rost/progress/, with what it needs and its contract. Install has the rest.
When to use
Known progress
Something with a known end: an upload, how much of the year's tax is set aside, steps through a form.
Near a limit
warningwhen it's getting close, like 90% of a budget. The words beside it say what the limit is.
When not to use
Unknown waits
When you don't know how long it'll take, there's nothing to fill. Show a Skeleton of what's coming.
A score
A rating or a level that isn't going anywhere. Write the number.
Behaviour
A 4px grey track with the fill on top, as wide as value out of max. It eases to a new value over 450ms, or jumps there for someone who asks for less motion. Write the number or the words next to it too: a thin bar is hard to read exactly.
Accessibility
- Element
<div role="progressbar">witharia-valuenow,aria-valuemin="0"andaria-valuemax. Progress sets them. - Name
label, asaria-label. - Colour
The fill is a graphic that carries meaning, so it needs 3:1 against the track. The tone is never the only signal: say "over budget" in words.
Content
The label says what it measures: "Tax set aside for 2026", not "Progress".
Props
| Prop | Type | Values | Default |
|---|---|---|---|
value | number | | |
max | number | | 100 |
tone | enum | positive · warning · negative | positive |
label | string | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
height4pxspacing/gap/2xsmall -
border-radius10000pxspacing/radius/full -
background#3a3a3aprogress/track
displayblock · positionrelative · overflowhidden · width100%
fill
-
border-radius10000pxspacing/radius/full -
transition-duration450msmotion/duration/slow -
transition-timing-functioncubic-bezier(0.4, 0, 0.2, 1)motion/easing/move
displayblock · height100% · transition-propertywidth
Changes by variant
3 variants. Each table is what one thing changes with: a column per tone, a row per property. Where every row starts with the same token path, it's written once, under the property.
Follows tone
| Property | Positive | Warning | Negative |
|---|---|---|---|
fill.backgroundprogress/fill/… | positive #00d669 | warning #fda50d | negative #f2705f |
Part of Progress
ProgressRing
Progress as a 40px ring, for where a bar won't fit: next to a Stat, in a card's corner. Green as it goes, amber or red when it needs a look.
PositiveWarningNegativeimport { ProgressRing } from 'rost/components/progress-ring/ProgressRing'
<ProgressRing value={4550} max={7000} label="Tax set aside for 2026" /> src/components/progress-ring/ProgressRing.tsx
import type { HTMLAttributes } from 'react'
import './progress-ring.css'
export interface ProgressRingProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
/** From 0 to `max`. */
readonly value: number
readonly max?: number
readonly tone?: 'positive' | 'warning' | 'negative'
/** What it measures. The ring's name for screen readers. */
readonly label: string
}
const b = 'rost-progress-ring'
/**
* Progress as a 40px ring. A `role="progressbar"` with its values set.
* Built from contracts/progress-ring.contract.yaml.
*/
export function ProgressRing({ value, max = 100, tone = 'positive', label, className, ...rest }: ProgressRingProps) {
const share = Math.min(Math.max(value / (max || 1), 0), 1)
return (
<span
role="progressbar"
aria-label={label}
aria-valuenow={value}
aria-valuemin={0}
aria-valuemax={max}
className={[b, `${b}--tone-${tone}`, className].filter(Boolean).join(' ')}
{...rest}
>
<svg className={`${b}__svg`} viewBox="0 0 40 40" aria-hidden="true">
<circle className={`${b}__track`} cx="20" cy="20" r="18" />
<circle className={`${b}__arc`} cx="20" cy="20" r="18" pathLength={100} strokeDasharray={`${share * 100} 100`} />
</svg>
</span>
)
}
The source for everything on this page: contracts/progress-ring.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: progress-ring
name: ProgressRing
kind: component
status: review
partOf: progress
summary: "Progress as a 40px ring, for where a bar won't fit: next to a Stat, in a card's corner. Green as it goes, amber or red when it needs a look."
category: feedback
related: [ progress, stat, spinner ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "749:20"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=749-20
extractedAt: "2026-11-17"
extractedBy: hand
frozenAt: "2026-11-17"
props:
value: { type: number, required: true, notes: "From 0 to `max`." }
max: { type: number, default: 100 }
tone:
type: enum
values: [ positive, warning, negative ]
default: positive
notes: "The same as Progress's: `warning` near a limit, `negative` over it. Say why in words too."
label: { type: string, required: true, notes: "What it measures. The ring's accessible name." }
elements:
root:
notes: "A `<span role=\"progressbar\">` with its values, 40px square, holding the SVG."
styles:
display: { value: inline-block, assert: false }
flex-shrink: { value: "0", assert: false }
width: { token: spacing/size/medium, value: 40px }
height: { token: spacing/size/medium, value: 40px }
svg:
notes: "The drawing, a 40 by 40 viewBox, turned so the ring starts at the top."
styles:
display: { value: block, assert: false }
width: { value: 100%, assert: false }
height: { value: 100%, assert: false }
transform: { value: rotate(-90deg), assert: false }
track:
notes: "The whole ring: a circle of radius 18 with a 4px stroke, in Progress's track grey."
styles:
fill: { value: none, assert: false }
stroke: { token: progress-ring/track, value: "#3a3a3a" }
stroke-width: { token: spacing/outline/large, value: 4px }
arc:
notes: "The same circle, drawn as far round as `value` out of `max`, with square ends. It eases to a new value."
styles:
fill: { value: none, assert: false }
stroke-width: { token: spacing/outline/large, value: 4px }
stroke-linecap: { value: butt, assert: false }
transition-property: { value: stroke-dasharray, assert: false }
transition-duration: { token: motion/duration/slow, value: 450ms }
transition-timing-function: { token: motion/easing/move, value: "cubic-bezier(0.4, 0, 0.2, 1)" }
reducedMotion:
notes: "It jumps to the new value for someone who asks for less motion."
elements:
arc:
transition-duration: { value: 0s, assert: false }
variants:
- when: { tone: positive }
figmaNode: "749:11"
elements:
arc:
stroke: { token: progress-ring/positive, value: "#00d669" }
- when: { tone: warning }
figmaNode: "749:14"
elements:
arc:
stroke: { token: progress-ring/warning, value: "#fda50d" }
- when: { tone: negative }
figmaNode: "749:17"
elements:
arc:
stroke: { token: progress-ring/negative, value: "#f2705f" }
guidance:
status: proposed
use:
- title: A share, next to its number
text: "How much of the year's tax is set aside, beside the figure itself. The ring is the glance, the number is the fact."
show: tone=positive
avoid:
- title: On its own
text: "A ring can't be read to the percent. Write the number next to it."
- title: Waiting
text: "Something loading with no known end is a **Spinner**."
behaviour: "It draws `value` out of `max` clockwise from the top, and eases to a new value over 450ms, or jumps there for someone who asks for less motion."
accessibility:
element: "`<span role=\"progressbar\">` with `aria-valuenow`, `aria-valuemin=\"0\"` and `aria-valuemax`. The SVG is hidden from screen readers."
name: "`label`, as `aria-label`."
colour: "The arc is a graphic that carries meaning: each tone is 3:1 or more against the track. The tone is never the only signal."
content: "The label says what it measures: Tax set aside for 2026."
Install
npx github:Runceanu/rost add progress-ring It lands in src/rost/progress-ring/, with what it needs and its contract. Install has the rest.
When to use
A share, next to its number
How much of the year's tax is set aside, beside the figure itself. The ring is the glance, the number is the fact.
When not to use
On its own
A ring can't be read to the percent. Write the number next to it.
Waiting
Something loading with no known end is a Spinner.
Behaviour
It draws value out of max clockwise from the top, and eases to a new value over 450ms, or jumps there for someone who asks for less motion.
Accessibility
- Element
<span role="progressbar">witharia-valuenow,aria-valuemin="0"andaria-valuemax. The SVG is hidden from screen readers. - Name
label, asaria-label. - Colour
The arc is a graphic that carries meaning: each tone is 3:1 or more against the track. The tone is never the only signal.
Content
The label says what it measures: Tax set aside for 2026.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
value | number | | |
max | number | | 100 |
tone | enum | positive · warning · negative | positive |
label | string | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
width40pxspacing/size/medium -
height40pxspacing/size/medium
displayinline-block · flex-shrink0
svg
displayblock · width100% · height100% · transformrotate(-90deg)
track
-
stroke#3a3a3aprogress-ring/track -
stroke-width4pxspacing/outline/large
fillnone
arc
-
stroke-width4pxspacing/outline/large -
transition-duration450msmotion/duration/slow -
transition-timing-functioncubic-bezier(0.4, 0, 0.2, 1)motion/easing/move
fillnone · stroke-linecapbutt · transition-propertystroke-dasharray
Changes by variant
3 variants. Each table is what one thing changes with: a column per tone, a row per property. Where every row starts with the same token path, it's written once, under the property.
Follows tone
| Property | Positive | Warning | Negative |
|---|---|---|---|
arc.strokeprogress-ring/… | positive #00d669 | warning #fda50d | negative #f2705f |