Components / FeedbackStable

Progress and steps

Shows how much of a known amount is done with a bar, the jobs behind it with a task list, or where someone is in a short sequence with steps.

View as Markdown

Playground

Uploading brand-guidelines.pdf

2.4 of 6 MB

  1. Details, doneName and dates
  2. Team, doneWho works on it
  3. TasksFirst milestones
  4. ReviewCheck and create

Code

Progress.tsx
import { useId } from 'react'

// Nacre Progress: shows how much of a known amount is done. Steps (Steps.tsx) shows where someone is in a short
// sequence. React plus Tailwind classes only; needs nacre-theme.css. Motion: the fill is a full-width bar scaled on X
// from its start edge (gentle 360 out), never resized, so a new value mid-flight retargets from where it is drawn. A
// round cap rides on its end by translate, so the end stays round at any scale. Indeterminate (no known amount): a
// segment 40 % wide sweeps across, a loop on the in-out curve; with reduced motion it rests in the middle.

export type ProgressSize = 'sm' | 'md'
export type ProgressTone = 'neutral' | 'accent' | 'success' | 'error'

export type ProgressProps = {
  label: string
  value: number
  max?: number
  hideLabel?: boolean
  showValue?: boolean
  hint?: string
  size?: ProgressSize
  tone?: ProgressTone
  /** The amount is not known yet: no value is announced and a segment sweeps across. */
  indeterminate?: boolean
  className?: string
}

const fills: Record<ProgressTone, string> = { neutral: 'bg-action', accent: 'bg-accent', success: 'bg-success', error: 'bg-error' }

export function Progress({ label, value, max = 100, hideLabel = false, showValue = false, hint, size = 'md', tone = 'neutral', indeterminate = false, className = '' }: ProgressProps) {
  const id = useId()
  const now = Number.isFinite(value) ? Math.min(Math.max(value, 0), max) : 0
  // Multiply first so whole percentages stay exact (0.4 * 100 is not 40 in floating point).
  const pct = max > 0 ? (now * 100) / max : 0
  return (
    <div data-part="root" className={`flex flex-col gap-2 ${className}`}>
      <div className="flex items-baseline justify-between gap-3">
        <span id={`${id}-label`} data-part="label" className={hideLabel ? 'sr-only' : 'text-label text-fg-strong'}>{label}</span>
        {showValue && !indeterminate && (
          <span data-part="value" aria-hidden="true" className="font-mono text-caption text-fg-muted tabular-nums">
            {`${Math.round(pct)}%`}
          </span>
        )}
      </div>
      <div
        role="progressbar"
        aria-labelledby={`${id}-label`}
        aria-valuemin={0}
        aria-valuemax={max}
        aria-valuenow={indeterminate ? undefined : now}
        aria-describedby={hint ? `${id}-hint` : undefined}
        data-part="track"
        className={`relative overflow-hidden rounded-full bg-sunken ${size === 'sm' ? 'h-1' : 'h-2 ring-1 ring-line-subtle'}`}
      >
        {indeterminate ? (
          <div data-part="indeterminate" className={`h-full w-2/5 translate-x-[75%] rounded-full motion-safe:animate-indeterminate ${fills[tone]}`} />
        ) : (
          <>
            <div
              data-part="fill"
              style={{ transform: `scaleX(${pct / 100})` }}
              className={`size-full origin-left transition-transform duration-(--nx-dur-gentle) ease-out rtl:origin-right ${fills[tone]}`}
            />
            {/* The cap's centre sits on the fill's end: a full-width layer moved by translate, a round end at its edge. */}
            <div
              data-part="cap"
              aria-hidden="true"
              style={{ transform: `translateX(calc(${pct - 100}% + ${size === 'sm' ? 2 : 4}px))` }}
              className={`absolute inset-0 flex justify-end transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:scale-x-[-1] ${pct > 0 ? '' : 'opacity-0'}`}
            >
              <span className={`aspect-square h-full rounded-full ${fills[tone]}`} />
            </div>
          </>
        )}
      </div>
      {hint && <p id={`${id}-hint`} data-part="hint" className="text-caption text-fg-muted">{hint}</p>}
    </div>
  )
}
Steps.tsx
import type { ReactNode } from 'react'

// Nacre Steps: shows where someone is in a short sequence. Server-safe like Progress (no hooks, no state). React plus
// Tailwind classes only; needs nacre-theme.css. Motion: while the current step is busy, an arc turns around its
// number. When the step finishes, the arc shrinks to .5 and blurs out, the marker fills (quick 160) and the check draws
// in left to right with clip-path (base 240 out, after the arc has gone), so the spinner reads as turning into the
// check. The connector to the next step fills the same quick 160. Reduced motion: the arc stands still and the change
// is instant.

export type Step = { label: string; description?: ReactNode }
export type StepsOrientation = 'horizontal' | 'vertical'
export type StepsProps = {
  label: string
  steps: Step[]
  current: number
  /** The current step is working (saving, checking): an arc turns around its number until current moves on. */
  busy?: boolean
  orientation?: StepsOrientation
  className?: string
}

const markerTone = {
  complete: 'bg-action text-on-action',
  current: 'border border-line-strong bg-surface text-fg-strong',
  upcoming: 'border border-line text-fg-muted',
} as const
// Busy: the ring steps back to a quiet line so the turning arc on it reads.
const busyTone = 'border border-line bg-surface text-fg-strong'

/** Steps before `current` are done, `current` is where the person is, the rest are ahead. current = steps.length: all done. */
export function Steps({ label, steps, current, busy = false, orientation = 'horizontal', className = '' }: StepsProps) {
  const row = orientation === 'horizontal'
  return (
    <ol aria-label={label} data-part="steps" className={`flex ${row ? '' : 'flex-col'} ${className}`}>
      {steps.map((s, i) => {
        const state = i < current ? 'complete' : i === current ? 'current' : 'upcoming'
        const last = i === steps.length - 1
        return (
          <li key={i} data-part="step" data-state={state} aria-current={state === 'current' ? 'step' : undefined} className={row ? 'flex min-w-0 flex-1 flex-col gap-2' : 'flex gap-3'}>
            <span className={row ? 'flex items-center' : 'flex flex-col items-center'}>
              <span data-part="marker" className={`relative inline-grid size-6 shrink-0 place-items-center rounded-full text-caption font-[600] transition-colors duration-(--nx-dur-quick) ease-out ${state === 'current' && busy ? busyTone : markerTone[state]}`}>
                {state === 'complete' ? (
                  <svg
                    data-part="check"
                    aria-hidden="true"
                    viewBox="0 0 16 16"
                    fill="none"
                    stroke="currentColor"
                    strokeWidth="2"
                    strokeLinecap="round"
                    strokeLinejoin="round"
                    className="col-start-1 row-start-1 size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]"
                  >
                    <path d="M3.5 8.5l3 3 6-7" />
                  </svg>
                ) : (
                  <span aria-hidden="true" className="col-start-1 row-start-1">{i + 1}</span>
                )}
                {/* Kept in every state, so leaving busy (or finishing) plays its exit instead of vanishing. */}
                <svg
                  data-part="spinner"
                  aria-hidden="true"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  strokeWidth="2"
                  strokeLinecap="round"
                  className={`pointer-events-none absolute -inset-px size-[calc(100%+2px)] text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin ${state === 'current' && busy ? '' : 'scale-50 opacity-0 blur-[2px]'}`}
                >
                  <path d="M12 1a11 11 0 0 1 11 11" />
                </svg>
              </span>
              {!last && (
                <span
                  data-part="connector"
                  aria-hidden="true"
                  className={`${row ? 'mx-2 h-px flex-1' : 'my-1 min-h-4 w-px flex-1'} transition-colors duration-(--nx-dur-quick) ease-out bg-line`}
                />
              )}
            </span>
            {/* In a row the text keeps 12 px clear of the next step and breaks long words with a hyphen, so neighbours
                never touch on a narrow screen. */}
            <span className={`flex min-w-0 flex-col gap-0.5 ${row ? `hyphens-auto [overflow-wrap:anywhere] ${last ? '' : 'pe-3'}` : last ? '' : 'pb-6'}`}>
              <span data-part="step-label" className={`text-label ${state === 'upcoming' ? 'text-fg-muted' : 'text-fg-strong'}`}>
                {s.label}
                {state === 'complete' && <span className="sr-only">, done</span>}
                {state === 'current' && busy && <span className="sr-only">, in progress</span>}
              </span>
              {s.description && <span className="text-caption text-fg-muted">{s.description}</span>}
            </span>
          </li>
        )
      })}
    </ol>
  )
}
TaskList.tsx
'use client'
import { useLayoutEffect, useRef, useState, type MouseEvent } from 'react'

// Nacre TaskList: the jobs behind a longer wait, each with its own state, so people see what is done, what runs now
// and what failed. Ships with Progress (the overall amount) and Steps (where someone is). React plus Tailwind classes
// only; needs nacre-theme.css. Motion: rows rise in 8 px, 40 ms apart. A running task turns an arc around its number;
// when it finishes, the arc shrinks and blurs out while a filled marker springs in (scale .5 to 1) and its check or
// cross draws in by clip-path. The status pill swaps with a blur. A task's own progress fills a soft green wash behind its row by scaleX.
// Opening a task's details reveals the row from its bottom edge by clip-path while the rows below slide down by
// translate (base 240 out); closing plays it back. A click mid-flight turns it around from where it is drawn.
// Keyboard toggles, reduced motion and [data-nacre-motion="off"] change at once.

export type TaskStatus = 'pending' | 'running' | 'done' | 'failed'
export type TaskDetail = { label: string; meta?: string }
export type Task = {
  id: string
  label: string
  status: TaskStatus
  /** A short amount at the end of the row: 48 pages, 12 swatches. */
  meta?: string
  /** 0 to 100 while running: shown as a percentage and a line under the row. */
  progress?: number
  details?: TaskDetail[]
}
export type TaskListProps = {
  label: string
  tasks: Task[]
  /** Ids of tasks whose details are open (controlled). Leave out to let the list keep its own. */
  open?: string[]
  defaultOpen?: string[]
  onOpenChange?: (open: string[]) => void
  /** Shows a Retry button on failed tasks. */
  onRetry?: (id: string) => void
  className?: string
}

const said: Record<TaskStatus, string> = { pending: 'waiting', running: 'in progress', done: 'done', failed: 'failed' }

function motionOk(el: Element): boolean {
  return !window.matchMedia('(prefers-reduced-motion: reduce)').matches && !el.closest('[data-nacre-motion="off"]')
}
function tokenMs(el: Element, name: string, fallback: number): number {
  const v = getComputedStyle(el).getPropertyValue(name).trim()
  const n = parseFloat(v)
  if (!Number.isFinite(n)) return fallback
  return v.endsWith('ms') ? n : v.endsWith('s') ? n * 1000 : n
}

/** Done and failed markers: a filled circle that springs in, its mark drawn left to right. Keyed by status, so a
 *  change mounts a new one and @starting-style plays its entry. */
function Mark({ status }: { status: 'done' | 'failed' }) {
  const done = status === 'done'
  return (
    <span
      data-part="mark"
      className={`absolute inset-0 grid place-items-center rounded-full text-on-action transition-[scale,opacity] duration-(--nx-dur-base) ease-spring starting:scale-50 starting:opacity-0 ${done ? 'bg-success' : 'bg-error-strong'}`}
    >
      <svg
        data-part={done ? 'check' : 'cross'}
        aria-hidden="true"
        viewBox="0 0 16 16"
        fill="none"
        stroke="currentColor"
        strokeWidth="2"
        strokeLinecap="round"
        strokeLinejoin="round"
        className="size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]"
      >
        <path d={done ? 'M3.5 8.5l3 3 6-7' : 'M4.5 4.5l7 7M11.5 4.5l-7 7'} />
      </svg>
    </span>
  )
}

export function TaskList({ label, tasks, open, defaultOpen = [], onOpenChange, onRetry, className = '' }: TaskListProps) {
  const [own, setOwn] = useState(defaultOpen)
  const openIds = open ?? own
  // Rows whose details stay mounted while their close plays.
  const [closing, setClosing] = useState<string[]>([])
  const rows = useRef(new Map<string, HTMLLIElement>())
  const anims = useRef(new Map<string, Animation[]>())
  // An open to play once its details are laid out, from this many px tall.
  const plan = useRef<{ id: string; from: number } | null>(null)

  const stop = (id: string) => {
    anims.current.get(id)?.forEach((a) => a.cancel())
    anims.current.delete(id)
  }
  const panelOf = (id: string) => rows.current.get(id)?.querySelector<HTMLElement>('[data-part="details"]') ?? null
  /** How tall a row's details are drawn right now (mid-flight included). */
  const tall = (id: string): number => panelOf(id)?.getBoundingClientRect().height ?? 0
  /** Moves a row's details between two heights. Height is animated here on purpose: the page below, and any frame
   *  around the list, must follow the row continuously, which a transform cannot do. Retargets from what is drawn. */
  const play = (id: string, from: number, to: number, done?: () => void) => {
    const panel = panelOf(id)
    const li = rows.current.get(id)
    if (!panel || !li) return done?.()
    stop(id)
    const full = panel.firstElementChild instanceof HTMLElement ? panel.firstElementChild.offsetHeight : Math.max(from, to, 1)
    const opts: KeyframeAnimationOptions = {
      duration: Math.max(120, tokenMs(li, '--nx-dur-base', 240) * (Math.abs(to - from) / Math.max(full, 1))),
      easing: getComputedStyle(li).getPropertyValue('--nx-ease-out').trim() || 'cubic-bezier(.23, 1, .32, 1)',
      fill: 'both',
    }
    const h = (px: number) => ({ height: `${px}px` })
    // The content rides with the reveal: it rises out of the row head as the box grows, so box and text move as one.
    const inner = panel.firstElementChild as HTMLElement | null
    const at = (px: number) => { const r = Math.min(Math.max(px / Math.max(full, 1), 0), 1); return { opacity: r, transform: `translateY(${(r - 1) * 10}px)` } }
    const list = [panel.animate([h(from), h(to)], opts)]
    if (inner) list.push(inner.animate([at(from), at(to)], opts))
    anims.current.set(id, list)
    list[0].onfinish = () => {
      if (anims.current.get(id) !== list) return
      if (done) done()
      else stop(id)
    }
  }

  const toggle = (id: string, e: MouseEvent) => {
    const li = rows.current.get(id)
    const willOpen = !openIds.includes(id)
    const next = willOpen ? [...openIds, id] : openIds.filter((x) => x !== id)
    // A keyboard click (detail 0) changes at once.
    const animate = !!li && e.detail > 0 && motionOk(li)
    if (willOpen) {
      plan.current = animate ? { id, from: closing.includes(id) ? tall(id) : 0 } : null
      if (!animate) stop(id)
      setClosing((c) => c.filter((x) => x !== id))
    } else if (animate) {
      const from = tall(id)
      setClosing((c) => [...c, id])
      play(id, from, 0, () => setClosing((c) => c.filter((x) => x !== id)))
    } else stop(id)
    if (open === undefined) setOwn(next)
    onOpenChange?.(next)
  }

  useLayoutEffect(() => {
    const p = plan.current
    if (p && openIds.includes(p.id)) {
      plan.current = null
      const inner = panelOf(p.id)?.firstElementChild as HTMLElement | null
      play(p.id, p.from, inner?.offsetHeight ?? 0, () => stop(p.id))
    }
    // A finished close has unmounted its details in this commit: let go of the held frames now, so nothing jumps.
    for (const id of [...anims.current.keys()]) if (!openIds.includes(id) && !closing.includes(id)) stop(id)
  })

  return (
    <ul aria-label={label} data-part="list" className={`flex flex-col gap-2 ${className}`}>
      {tasks.map((t, i) => {
        const shown = openIds.includes(t.id) || closing.includes(t.id)
        const expanded = openIds.includes(t.id)
        const hasDetails = !!t.details?.length
        const running = t.status === 'running'
        const pct = running && t.progress !== undefined ? Math.min(Math.max(Math.round(t.progress), 0), 100) : undefined
        const panelId = `task-${t.id}-details`
        const head = (
          <>
            <span data-part="status" className="relative grid size-6 shrink-0 place-items-center">
              <span aria-hidden="true" className={`absolute inset-0 rounded-full border bg-surface transition-colors duration-(--nx-dur-quick) ease-out border-line-control`} />
              <span aria-hidden="true" className={`text-caption font-[500] tabular-nums ${running ? 'text-fg-strong' : 'text-fg-muted'}`}>{i + 1}</span>
              {/* Kept in every state, so finishing plays its exit instead of vanishing. */}
              <svg
                data-part="spinner"
                aria-hidden="true"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="2"
                strokeLinecap="round"
                className={`pointer-events-none absolute inset-0 size-full text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin ${running ? '' : 'scale-50 opacity-0 blur-[2px]'}`}
              >
                <path d="M12 1a11 11 0 0 1 11 11" />
              </svg>
              {(t.status === 'done' || t.status === 'failed') && <Mark key={t.status} status={t.status} />}
            </span>
            <span data-part="task-label" className={`min-w-0 flex-1 truncate text-label font-[600] ${t.status === 'pending' ? 'text-fg-muted' : 'text-fg-strong'}`}>
              {t.label}
              <span className="sr-only">{`, ${said[t.status]}${pct !== undefined ? ` ${pct}%` : ''}`}</span>
            </span>
            {pct !== undefined ? (
              <span data-part="meta" aria-hidden="true" className="shrink-0 font-mono text-caption text-fg-muted tabular-nums">{`${pct}%`}</span>
            ) : (
              // The amount gives way on a narrow row, and next to Retry, so the label keeps its room.
              t.meta && !(t.status === 'failed' && onRetry) && (
                <span data-part="meta" className="hidden shrink-0 text-caption text-fg-muted tabular-nums @min-[18rem]:inline">{t.meta}</span>
              )
            )}
            {(t.status === 'done' || t.status === 'failed') && (
              <span
                key={t.status}
                data-part="pill"
                aria-hidden="true"
                className={`inline-flex h-6 shrink-0 items-center rounded-full px-2.5 text-caption font-[600] transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out starting:scale-90 starting:opacity-0 starting:blur-[4px] ${t.status === 'done' ? 'bg-success-soft text-success-strong' : 'bg-error-soft text-error-strong'}`}
              >
                {t.status === 'done' ? 'Done' : 'Failed'}
              </span>
            )}
            {hasDetails && (
              <svg
                data-part="chevron"
                aria-hidden="true"
                viewBox="0 0 16 16"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                className={`size-4 shrink-0 text-icon-muted transition-[rotate] duration-(--nx-dur-base) ease-out ${expanded ? 'rotate-180' : ''}`}
              >
                <path d="M4 6l4 4 4-4" />
              </svg>
            )}
          </>
        )
        return (
          <li
            key={t.id}
            ref={(el) => {
              if (el) rows.current.set(t.id, el)
              else rows.current.delete(t.id)
            }}
            data-part="task"
            data-state={t.status}
            style={{ transitionDelay: `${i * 40}ms` }}
            className="@container relative overflow-hidden rounded-md border border-line-subtle bg-sunken transition-[opacity,translate] duration-(--nx-dur-gentle) ease-out starting:translate-y-2 starting:opacity-0"
          >
            <div className="flex items-center">
              {hasDetails ? (
                <button
                  type="button"
                  data-part="trigger"
                  aria-expanded={expanded}
                  aria-controls={shown ? panelId : undefined}
                  onClick={(e) => toggle(t.id, e)}
                  className="flex min-h-11 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-md px-3 text-start transition-colors duration-(--nx-dur-quick) ease-out hover:bg-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus"
                >
                  {head}
                </button>
              ) : (
                <div className="flex min-h-11 min-w-0 flex-1 items-center gap-3 px-3">{head}</div>
              )}
              {t.status === 'failed' && onRetry && (
                <button
                  type="button"
                  data-part="retry"
                  onClick={() => onRetry(t.id)}
                  className="me-2 inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border border-line bg-secondary px-2.5 text-caption font-[600] text-fg-strong transition-[opacity,scale,background-color] duration-(--nx-dur-quick) ease-out hover:border-line-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus starting:scale-90 starting:opacity-0"
                >
                  <svg aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" className="size-3.5">
                    <path d="M13 8a5 5 0 1 1-1.5-3.55M13 2.5v3h-3" />
                  </svg>
                  Retry
                  <span className="sr-only">{` ${t.label}`}</span>
                </button>
              )}
            </div>
            {/* The task's own progress: a soft green wash across the row head, scaled from its start, behind the content. */}
            <span aria-hidden="true" className="pointer-events-none absolute inset-x-0 top-0 h-11">
              <span
                data-part="bar"
                style={{ transform: `scaleX(${(pct ?? (t.status === 'done' ? 100 : 0)) / 100})` }}
                className={`block size-full origin-left bg-success-soft/60 transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:origin-right ${pct !== undefined ? '' : 'opacity-0'}`}
              />
            </span>
            {hasDetails && shown && (
              <div id={panelId} data-part="details" className="overflow-hidden">
                <div>
                  <ul className="flex flex-col gap-1.5 border-t border-line-subtle py-3 ps-12 pe-4">
                    {t.details!.map((d, j) => (
                      <li
                        key={d.label}
                        data-part="detail"
                        className="flex items-baseline justify-between gap-3"
                      >
                        <span className="min-w-0 text-caption text-fg">{d.label}</span>
                        {d.meta && <span className="shrink-0 font-mono text-caption text-fg-muted tabular-nums">{d.meta}</span>}
                      </li>
                    ))}
                  </ul>
                </div>
              </div>
            )}
          </li>
        )
      })}
    </ul>
  )
}

Usage

When to use

  • Progress: uploads, imports and other waits with a known size.
  • Progress: a share of a goal, such as 12 of 20 tasks done this sprint.
  • Steps: a setup flow of three to five screens, such as creating a project.
  • TaskList: a wait made of separate jobs (upload, read, convert), where one can fail and be retried on its own.

Choose something else when

In the Nacre workspace

Upload brand files

Dropping a PDF into a project shows a Progress bar with the file name, the percentage and 2.4 of 6 MB as its hint. A failed upload turns the bar to error and says why.

Import brand files

Under the upload bar a TaskList names the four jobs. The one running turns its arc and shows its own percentage; a font that cannot be matched marks its task failed with a Retry button, while the others finish.

Create a project

The new project flow shows four Steps across the top: Details, Team, Tasks, Review. Finished steps get a check; the current one is announced as the current step.

Do and don't

  • DoSay what is progressing in the label: Uploading brand-guidelines.pdf.

    Don'tLabel it Loading.

  • DoGive each task a verb and an object: Pull out colours.

    Don'tShow internal job names such as extract_v2.

  • DoKeep Steps to five or fewer, with short labels.

    Don'tSqueeze eight steps across a phone; use vertical Steps instead.

Anatomy

Uploading brand-guidelines.pdf
  1. Details, doneName and dates
  2. Team, doneWho works on it
  3. TasksFirst milestones
  4. ReviewCheck and create
    • Checked the file typePDF
    • Sent in 3 parts6 MB
  1. Label. Label 13/16 at weight 500 in fg-strong, 8 px above the bar.
  2. Value. Caption 12/16 in Geist Mono with tabular figures, fg-muted.
  3. Track. 8 px (md, with a 1 px hairline ring) or 4 px (sm) sunken bar, radius full.
  4. Fill. Action fill, radius full, moved with translateX so its round end never squashes.
  5. Task status. 24 px: a numbered ring while waiting, an action arc turning while running, success or error-strong filled with a drawn check or cross.
  6. Task meta. Caption 12/16, tabular figures, fg-muted: the amount (hidden on rows under 18rem and next to Retry), or the percentage in Geist Mono while running.
  7. Status pill. Caption 12/16 at weight 600: Done in success on a white pill, Failed in error on the soft step.
  8. Details. Opened from the row: caption lines with mono amounts, under a 1 px line-subtle rule.
  9. Step marker. 24 px circle: filled action with a check when done, a soft ring when current, a lighter one when ahead (the number inside names the step).
  10. Connector. A 1 px line between markers, action once the step before it is done.
  11. Step label. Label 13/16; fg-strong when done or current, fg-muted ahead. Optional caption below.

API

labelType stringDefault -Required. Names the bar (aria-labelledby); hideLabel keeps it for assistive tech only.
valueType numberDefault -Done so far, clamped between 0 and max.
maxType numberDefault 100The full amount.
hideLabelType booleanDefault falseHides the label visually.
showValueType booleanDefault falseShows the percentage at the end of the label row (Geist Mono, tabular figures).
hintType stringDefault -A line under the bar, linked with aria-describedby: 2.4 of 6 MB.
sizeType 'sm' | 'md'Default 'md'Bar height 4 or 8 px.
toneType 'neutral' | 'accent' | 'success' | 'error'Default 'neutral'Fill colour: action, the accent blue, success when finished, error when it failed.
indeterminateType booleanDefault falseThe amount is not known yet: a segment sweeps across and no value is announced. Switch to a value as soon as there is one.
stepsType Step[]Default -Steps: label and optional description for each step.
currentType numberDefault -Steps: index of the current step. Earlier steps are done; steps.length marks all done.
busyType booleanDefault falseSteps: the current step is working; an arc turns around its number and turns into the check when current moves on.
tasksType Task[]Default -TaskList: id, label, status ('pending' | 'running' | 'done' | 'failed'), optional meta, progress (0 to 100 while running) and details.
openType string[]Default -TaskList: ids of tasks whose details are open, when you control it; with onOpenChange.
defaultOpenType string[]Default []TaskList: tasks open at first, when the list keeps its own state.
onOpenChangeType (open: string[]) => voidDefault -TaskList: called with the new open ids when a task is opened or closed.
onRetryType (id: string) => voidDefault -TaskList: shows a Retry button on failed tasks and is called with the task id.
orientationType 'horizontal' | 'vertical'Default 'horizontal'Steps: in a row with connectors, or a column for phones and long labels.

Motion

Value changeProperty transform: scaleX of a full-width fill from its start edge; a round cap rides on the end by translateDuration gentle 360Easing outKeyboard Same; the value never moves because of a key press.
IndeterminateProperty translate of a 40 % segment across the track, a loop (2.5 slow per pass)Duration slow 520Easing in-outKeyboard Same. Rests in the middle with reduced motion or Motion off.
Busy stepProperty rotate of an arc around the number, one turn per slowDuration slow 520Easing linearKeyboard Same. Stands still with reduced motion.
A step completesProperty the arc scales to .5 and blurs out; the check draws in by clip-path, 80 ms laterDuration base 240Easing outKeyboard Same, the component is reporting progress.
A task finishes or failsProperty the arc scales to .5 and blurs out; a filled marker springs in (scale .5 to 1, opacity) and its mark draws by clip-pathDuration base 240Easing springKeyboard Same, the component is reporting progress.
Status pillProperty opacity, scale .9 to 1, blur 4 pxDuration quick 160Easing outKeyboard Same.
Task progressProperty transform: scaleX of a soft green wash behind the row headDuration gentle 360Easing outKeyboard Same.
Open or close detailsProperty height of the details (the one layout property animated, so the rows below and any frame around follow), with the content rising out of the row head by opacity and translate; the chevron rotates. Turns around mid-flight from the height drawnDuration base 240Easing outKeyboard Instant from Enter or Space; the chevron still turns.
Rows enterProperty opacity, translate 8 px, 40 ms apartDuration gentle 360Easing outKeyboard Same.
Step stateProperty background-color, border-colorDuration quick 160Easing outKeyboard Same, colour only.
Uploading brand-guidelines.pdf

2.4 of 6 MB

Preparing the export

Counting the files first.

  1. DetailsName and dates
  2. TeamWho works on it
  3. TasksFirst milestones
  4. ReviewCheck and create

Accessibility

Keyboard

Tab
Moves to a task that has details, then to its Retry button. Progress and Steps are not focusable.
Enter, Space
Opens or closes the focused task's details, at once.

ARIA and semantics

  • Progress is role progressbar with aria-valuenow, aria-valuemin and aria-valuemax, named by its label and described by its hint.
  • Steps is an ordered list named by its label; the current step has aria-current="step" and done steps end with a hidden ", done".
  • Step numbers are aria-hidden: the list already says 2 of 4.
  • TaskList is a list named by its label. Each task ends with a hidden state (waiting, in progress 40%, done, failed); a task with details is a button with aria-expanded and aria-controls.
  • indeterminate leaves aria-valuenow out, so the bar is announced as busy with no amount; a busy step ends with a hidden ", in progress".

Contrast

Labelsfg-strong on pageLight 17.30:1Dark 17.44:1Needs 4.5:1
Value, hint, step captionsfg-muted on pageLight 5.07:1Dark 7.15:1Needs 4.5:1
Fill on the trackaction on sunkenLight 16.42:1Dark 17.91:1Needs 3:1
Success fillsuccess on sunkenLight 3.81:1Dark 13.50:1Needs 3:1
Error fillerror on sunkenLight 4.43:1Dark 6.57:1Needs 3:1
Check on a done stepon-action on actionLight 17.74:1Dark 17.30:1Needs 4.5:1
Task meta, waiting numberfg-muted on surfaceLight 5.57:1Dark 6.68:1Needs 4.5:1
Check on a done task (a graphic, 3:1)on-action on successLight 4.12:1Dark 13.04:1Needs 3:1
Cross on a failed taskon-action on error-strongLight 6.00:1Dark 11.68:1Needs 4.5:1
Done pillsuccess-strong on surfaceLight 6.56:1Dark 13.68:1Needs 4.5:1
Accent fill on the trackaccent on sunkenLight 4.97:1Dark 8.47:1Needs 3:1
Task meta on the rowfg-muted on sunkenLight 5.16:1Dark 7.35:1Needs 4.5:1
Failed pillerror-strong on error-softLight 4.74:1Dark 8.72:1Needs 4.5:1