Krizaka
Documentation

Stepper

The steps of a journey or a job: done steps checked, the current one traced by the Krizaka glyph (growing to its value), failures crossed, connectors that fill — and every state said in words.

WebBêtaNavigation

Web uniquement — React, depuis @krizaka/ui/stepper. Bêta : son API peut encore changer à une version mineure.

Quand l’utiliser

  • A job the user follows in steps: an upload that is checked, transcoded and published; a payout; an import.
  • A short journey with a known order: a checkout, an onboarding (orientation="horizontal").
  • A history of what happened, in order (a timeline of a request).

Quand ne pas l’utiliser

  • For one task with a known size and no steps.À la place : Progress
  • To switch between views the user can visit in any order.À la place : Tabs

Installation

Installer

npm install @krizaka/ui@beta @krizaka/tailwind@beta @krizaka/tokens@beta tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Importer

import { Stepper } from "@krizaka/ui/stepper";

Exemples

A job in steps

Uploaded, checked, transcoding (traced, with its Progress and ETA), then published.

  1. Uploaded — Done

    1.2 GB in 48 s

  2. Checked — Done

    Format, rights, safety

  3. Transcoding — In progress

    4K, 1080p, 720p

  4. Published — Upcoming

    Visible to your supporters

A failed step

A cross, the danger colour, “Failed” in words — and the action that fixes it.

  1. Requested — Done

    €1,240.00

  2. Bank transfer — Failed

    The bank refused the account number

  3. Received — Upcoming

A short journey

orientation="horizontal": the connectors fill as it advances.

  1. Plan — Done

  2. Payment — Current step

  3. Confirmation — Upcoming

Props

An ordered list of steps: aria-current="step" on the current one, each state said in words.

PropTypeDéfautDescription
labelsrequisReadonly<Record<StepStatus, string>>—What each state is called, read with every step (“Done”, “In progress”, “Upcoming”, “Failed”) — passed translated.
stepsrequisreadonly Step[]—The steps, in order.
currentnumber0The index of the current step: those before it are done, those after it upcoming (a step's own status wins).
orientation"horizontal" | "vertical"verticalvertical (a job, a timeline) · horizontal (a short journey, a checkout).

Accessibilité

  • An ordered list (name it with aria-label); the current step has aria-current="step".
  • Each step's state is read with its title (labels, translated): never colour alone.
  • Under prefers-reduced-motion the current glyph rests on a still frame and the connectors do not animate.

Bonnes pratiques

  • Name steps by what happens (“Transcoding”), with a line of detail (a size, a time).
  • Put what the user can do or watch into the current or failed step's content: a Progress with its ETA, a retry.
  • A failure says what went wrong and what to do next, in the step itself.

Générée depuis le code de @krizaka/ui 2.3.0 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page