# Steps

Work in steps under a head that counts: each line's verb quiet, its object a rank up, its figure right after them.

Live variants: https://design.arcadia.is/components/steps

```tsx
import { Steps, StepLine } from "@arcadia/ui";
```

On a narrow screen, a figure can move below the step name.

```tsx
import { useState } from "react";
import {
  Collapsible, CollapsibleHeader, CollapsiblePanel, Steps, StepLine, Elapsed,
} from "@arcadia/ui";

function StepsTrail() {
  const [since] = useState(() => Date.now() - 4000);
  return (
    <div {...sx("cmp-steps-column", [cmp.stream, StepsS.column])}>
      <Collapsible tone="muted" defaultOpen>
        <CollapsibleHeader action="Searches" figure={3} />
        <CollapsiblePanel>
          <Steps>
            <Collapsible step tone="muted" defaultOpen>
              <CollapsibleHeader action="Restart prompt" wrapAction figure={3} />
              <CollapsiblePanel>
                <Steps indent={false}>
                  <StepLine href="https://example.com/updates" target="_blank" mark="globe" figure="example.com">Restart after update</StepLine>
                  <StepLine href="https://example.org/forum" target="_blank" mark="globe" figure="forum.example.org">Restart mid-task</StepLine>
                  <StepLine href="https://docs.example.net" target="_blank" mark="globe" figure="docs.example.net">Update channels</StepLine>
                </Steps>
              </CollapsiblePanel>
            </Collapsible>
            <StepLine verb="Searched" tone="quiet" figure="4 results">Release channels</StepLine>
            <StepLine mark="check" figure="2 tasks">Finished background checks</StepLine>
            <StepLine live figure={<Elapsed since={since} />}>Background updates</StepLine>
          </Steps>
        </CollapsiblePanel>
      </Collapsible>
    </div>
  );
}
```

## Accessibility

Each line reads as its words in order: the verb, the object, then the figure. A Collapsible line is a disclosure button; a link row is a real link, reached by Tab and opened with Enter, with the neutral focus ring inside its fill. Marks are hidden from assistive tech: say a state the verb does not already say in the words.

## API reference

### Steps

- `indent` (`boolean`, default `true`): Under a head: the lines start `--space-6` in, with no guide and no box. `false`: on the head's own edge.
- `rootStyle` (`RootStyle<StepsKnobs>`)

Rest props go to `HTMLAttributes<HTMLDivElement>`.

### StepLine

- `verb` (`string`): The verb before it, quiet ("Read", "Searched").
- `mark` (`IconName | ReactNode`): An icon's name or an element, hung in the indent before the text edge (the state's mark, a page's glyph).
- `figure` (`ReactNode`): What the step came to ("4 results", "github.com", a time): a small step after the words, never cut; the words give way.
- `href` (`string`): The line is a link: it opens `href`, takes the row's fill under the pointer, and draws no underline.
- `target` (`string`): Where the link opens (`_blank` adds `rel="noreferrer"`).
- `live` (`boolean`, default `false`): Running now: the words shimmer.
- `tone` (`"default" | "quiet"`, default `"default"`): `quiet`: done or not started, the object steps down to the verb's ink.
- `rootStyle` (`RootStyle`): A component's typed override prop: `Layout` and its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).
- `children` (`ReactNode`, required): The object: a page's title, a to-do, a path. A rank over the verb; it truncates first.

Rest props go to `HTMLAttributes<HTMLElement>`.
