Skip to content

ProgressSteps

The steps of something the system is doing, as they happen: a deploy, an import. Each says whether it is done, running, waiting, failed or skipped.

import { ProgressSteps, ProgressStepsSkeleton } from '@sypnia/ui/react'

On this page
  1. A deploy as it happens
  2. A step that failed
  3. When to use it
  4. For everyone
  5. Props

A deploy as it happens

  1. Build, done
  2. Run the tests, done
  3. Upload, running12 of 40 files
  4. Switch traffic, waiting
Code
import { useEffect, useState } from 'react';
import { Button, ProgressSteps, ProgressStepsSkeleton, type ProgressStep } from '@sypnia/ui/react';

// A deploy as it happens. Press «Deploy again» to watch the light move down; the skeleton is on the right.
const names = ['Build', 'Run the tests', 'Upload', 'Switch traffic'];
export default function Deploy() {
  const [at, setAt] = useState(2);
  useEffect(() => { if (at >= names.length) return; const id = setTimeout(() => setAt(at + 1), 1400); return () => clearTimeout(id); }, [at]);
  const steps: ProgressStep[] = names.map((label, i) => ({ label, state: i < at ? 'done' : i === at ? 'running' : 'waiting', detail: i === 2 && i === at ? '12 of 40 files' : undefined }));
  return (
    <div className="sy-grid">
      <div className="sy-stack"><ProgressSteps label="Deploy of shop" steps={steps} /><Button size="sm" onClick={() => setAt(0)}>Deploy again</Button></div>
      <ProgressStepsSkeleton steps={4} />
    </div>
  );
}

A step that failed

  1. Read the file, done4,310 rows
  2. Check the columns, failedThe column «email» is empty in 12 rows. Fill them or remove those rows and import again.
  3. Save the rows, skipped
Code
import { ProgressSteps } from '@sypnia/ui/react';

// When a step fails, the ones after it are skipped and the failed one says why.
export default function Failed() {
  return <ProgressSteps label="Import of customers.csv" steps={[
    { label: 'Read the file', state: 'done', detail: '4,310 rows' },
    { label: 'Check the columns', state: 'failed', detail: 'The column «email» is empty in 12 rows. Fill them or remove those rows and import again.' },
    { label: 'Save the rows', state: 'skipped' },
  ]} />;
}

When to use it

Use it when

  • Long tasks with clear steps the person may wait for.
  • When a step fails, say why in its detail and skip the rest.

Do not use it when

  • Steps the person does: use a Stepper or a Wizard.
  • Tasks of a few seconds: a busy button is enough.

For everyone

  • Each state is said in words to screen readers, not only with the marks.
  • The running step is aria-current="step".

Props

ProgressStepsTypeDefault
labelrequired string
stepsrequired ProgressStep[]
ProgressStepsSkeletonTypeDefault
steps number 4
  1. A deploy as it happens
  2. A step that failed
  3. When to use it
  4. For everyone
  5. Props

    Search pages, sections and terms