# Step marks

Where a walk of a few steps stands: one mark a step, the current one in ink, and the figure alone past 24 steps.

Live variants: https://design.arcadia.is/components/step-marks

```tsx
import { StepMarks } from "@arcadia/ui";
```

```tsx
import { useState } from "react";
import { AuthSurface, Button, StepMarks } from "@arcadia/ui";

function Walk() {
  const [step, setStep] = useState(1);
  const last = step === TITLES.length;
  return (
    <AuthSurface bare title={TITLES[step - 1]!} footer={<StepMarks step={step} count={TITLES.length} aria-live="polite" />}>
      <Button variant="primary" onClick={() => setStep(last ? 1 : step + 1)}>
        {last ? "Restart preview" : "Next step"}
      </Button>
    </AuthSurface>
  );
}
```

```tsx
import { StepMarks } from "@arcadia/ui";

<StepMarks step={26} count={32} mark="done" failed={[14]} />
```

## Accessibility

The marks are hidden from a reader; one line of text, visually hidden, says "Step 1 of 3" in their place, read as plain text where the marks stand. The current mark is taller and brighter. Earlier marks are quieter, and the step's title says where you are. Under forced colours, which drop every fill, the marks take the system's quiet ink and the current one its highlight; a failed one keeps its break in the system's ink.

## API reference

### StepMarks

- `step` (`number`, required): The step the walk is on, from 1; with `mark="done"`, how many steps are done, from 0.
- `count` (`number`, required): How many steps the walk has.
- `mark` (`"current" | "done"`, default `"current"`): `current`: the step the walk is on, in ink. `done`: every step done so far, in ink, the rest quiet: work's progress.
- `failed` (`readonly number[]`): With `mark="done"`, the steps that failed, by number from 1: each a broken dash in the error colour, so it reads in grey too. One within the steps done is one the work got past, and the row runs on after it; one beyond them still stands.
- `rootStyle` (`RootStyle`): Typed StyleX override: layout.

Rest props go to `HTMLAttributes<HTMLDivElement>`.
