# Steps

A sequence everyone goes through in order, every step in view, as an ordered list numbered once by the list: how it works from the first action to the result, a first visit, an order on its way, a project's phases. items, two to five, each a title, one description line, meta (the one fact only this business could state: how long, when, where, what it costs) and media (the real thing at that moment: a picture of the product's screen, a CodeBlock, a Media photo). The last step is the result and leads: its number filled, and in a row its media two tracks wide. layout auto lays the steps side by side where the list's own width holds them (about 14rem a track of words, 18rem of views; more steps than fit stay one under another), titles, lines, facts and views level across the row, and one under another below it, each view beside its words from 36rem; timeline keeps them one under another and draws each step's duration (a number in one unit for every step) to scale, beside its title from 36rem and under its words below. headingLevel sets the titles' level (default 3). Not for things that happen in no order (features, options, ways to help), and not a progress indicator; nothing in it moves.

Page: https://turtlekit.dev/components/steps

## Import

```tsx
import { Steps } from "turtlekit";
```

## Props

### Steps

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `items` (required) | `ReadonlyArray<StepsItem>` |  | The steps in the order everyone goes through them, two to five. |
| `layout` | `"auto" \| "timeline"` | `auto` | "auto" (default): the steps side by side where the list's own width holds them, one under another below it. "timeline": one under another at every width, each step's length drawn to scale from its duration (a project's phases in weeks, a visit's parts in minutes): beside its title from 36rem, under its words below. |
| `headingLevel` | `2 \| 3 \| 4` | `3` | The steps' titles' level in the page outline. |

## Shapes its props take

### StepsItem

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `title` (required) | `ReactNode` |  | What happens, in the visitor's words: "Send the invoice", "Your first assessment". |
| `description` | `ReactNode` |  | One line under the title: what happens at this step, and who does it. |
| `meta` | `ReactNode` |  | The one fact only this business could state about the step: how long, when, where, what it costs ("45 minutes", "Weeks 2 to 3", "£55, follow-ups £45"). |
| `media` | `ReactNode` |  | The real thing at this step: a picture of the product's screen at that moment, a CodeBlock, a Media photograph. |
| `duration` | `number` |  | How long the step takes, as a number in one unit for every step (weeks for a project, minutes for a visit). |

## Rules it keeps

- `anti.layout-from-content`
- `anti.specific-claims`
- `type.heading-order`

## Examples

Every example on the page, as one file:

```tsx
import { CodeBlock, Heading, Num, Stack, Steps, Text } from "turtlekit";

/**
 * A first visit, from booking to the plan: each step what happens and its one fact (the price at the first, the
 * minutes, what follows). The plan, the result, leads.
 */
export function FirstVisit() {
  return (
    <Stack gap="intro">
      <Stack gap="heading">
        <Heading as="h2">Your first hour at the clinic</Heading>
        <Text as="p" variant="section-description">
          What happens at a first assessment, and what you leave with.
        </Text>
      </Stack>
      <Steps
        items={[
          {
            title: "Book a time",
            description: "Choose a physio and a time online; a text reminds you the day before.",
            meta: (
              <>
                <Num value={55} format="currency" currency="GBP" maximumFractionDigits={0} />, paid at the
                clinic
              </>
            ),
          },
          {
            title: "Talk it through",
            description: "How it started and what makes it worse. Wear shorts or loose clothes.",
            meta: "The first 15 minutes",
          },
          {
            title: "Tests and treatment",
            description: "Your physio checks how you move, then starts treating it.",
            meta: "About 30 minutes",
          },
          {
            title: "Leave with a plan",
            description:
              "Exercises on your phone, how many sessions it should take, and a receipt for your insurer.",
            meta: (
              <>
                Follow-ups <Num value={45} format="currency" currency="GBP" maximumFractionDigits={0} />
              </>
            ),
          },
        ]}
      />
    </Stack>
  );
}

/** Code first, for builders: install, one call, then what comes back, shown last and widest. */
export function FirstCall() {
  return (
    <Stack gap="intro">
      <Stack gap="heading">
        <Heading as="h2">Your first invoice from code, in five minutes</Heading>
        <Text as="p" variant="section-description">
          One package, one call, and the invoice is on its way.
        </Text>
      </Stack>
      <Steps
        items={[
          {
            title: "Install",
            description: "The client for Node, with its types.",
            media: (
              <CodeBlock label="Install the Northwind client" language="shell">
                npm install @northwind/node
              </CodeBlock>
            ),
          },
          {
            title: "Send an invoice",
            description: "One call with the client's email and the lines.",
            media: (
              <CodeBlock label="Send an invoice" language="ts">
                {`await northwind.invoices.send({
  to: "accounts@brightwater.example",
  lines: [{ what: "Brand refresh", amount: 2400 }],
});`}
              </CodeBlock>
            ),
          },
          {
            title: "It is on its way",
            description: "The invoice comes back sent, with the link your client pays from.",
            meta: "Usually under a second",
            media: (
              <CodeBlock label="The invoice that comes back" language="json">
                {`{
  "id": "inv_0048",
  "status": "sent",
  "total": 2400,
  "pay_url": "https://pay.northwind.example/inv_0048"
}`}
              </CodeBlock>
            ),
          },
        ]}
      />
    </Stack>
  );
}

/** A project's phases on a timeline drawn to scale in weeks: what happens, the client's part, what they receive. */
export function ProjectPhases() {
  return (
    <Stack gap="intro">
      <Stack gap="heading">
        <Heading as="h2">Eight weeks from first call to files</Heading>
        <Text as="p" variant="section-description">
          A brand identity, phase by phase. The next project can start in March.
        </Text>
      </Stack>
      <Steps
        layout="timeline"
        items={[
          {
            title: "First call",
            description: "What the brand must do and for whom; you get a written plan and a fixed price.",
            meta: "Week 1",
            duration: 1,
          },
          {
            title: "Discovery",
            description: "Workshops with your team and five customer interviews. Your part: two half-days.",
            meta: "Weeks 2 to 3",
            duration: 2,
          },
          {
            title: "Design",
            description: "Two directions, then one refined with your feedback every Friday.",
            meta: "Weeks 4 to 7",
            duration: 4,
          },
          {
            title: "Files and guide",
            description:
              "The logo, type and colours, with a guide and every file your printer and developers need.",
            meta: "Week 8",
            duration: 1,
          },
        ]}
      />
    </Stack>
  );
}
```
