# Onboarding checklist

> The first five things, ticked off in place: a ring that fills, checks that draw, and a finish worth seeing.

A checklist is the first thing a new customer sees, and most are a static list of links. Here the next task is open in place: what it is, why it matters and the one button that does it. That button runs your action with a spinner and a morphing label; when it lands, a check draws itself on the row, a strike draws through the label, the next task opens, the ring fills a step and "2 of 5" rolls. Any row can be opened to revisit it, and the whole card folds to its header. When the last task is done the list folds away, the ring becomes a check with a small burst, and the title morphs to "You’re all set".

## Install

```bash
npx shadcn@latest add https://hairlineui.com/r/onboarding-checklist.json
```

Needs React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

- npm: none
- Hairline UI components it needs (the CLI installs them too): `number-roll`, `text-morph`
- Docs and live preview: https://hairlineui.com/ui/onboarding-checklist
- Registry item (source): https://hairlineui.com/r/onboarding-checklist.json

## Usage

```tsx
import { OnboardingChecklist } from "@/components/onboarding-checklist";

<OnboardingChecklist
  tasks={[
    { id: "menu", title: "Add your menu", description: "Flavours, sizes and prices.", action: { label: "Import menu", pendingLabel: "Importing", onClick: importMenu } },
    { id: "payments", title: "Connect payments", action: { label: "Connect", href: "/settings/payments" } },
  ]}
/>
```

## From your data

Pass done from your database so progress survives a reload, and mark tasks done as their actions land.

```tsx
"use client";
import { OnboardingChecklist } from "@/components/onboarding-checklist";
import { useOnboarding } from "@/lib/onboarding";

export function GetStarted() {
  const { steps, complete, dismiss } = useOnboarding();
  return (
    <OnboardingChecklist
      tasks={steps.map((s) => ({
        id: s.id,
        title: s.title,
        description: s.description,
        done: s.done,
        action: { label: s.cta, pendingLabel: s.pending, onClick: () => s.run() },
      }))}
      onTaskComplete={(id) => complete(id)}
      onDismiss={dismiss}
    />
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tasks` | `OnboardingTask[]` | – | id, title, and any of description, done (controlled), and action { label, pendingLabel?, onClick? (return a promise to show progress), href? }. |
| `title / doneTitle / doneDescription` | `string` | `"Get started" / "You’re all set" / …` | The heading before and after, and the line shown once everything’s done. |
| `onTaskComplete` | `(id) => void` | – | Called when a task’s action resolves; mark it done here if you control done. |
| `onDismiss` | `() => void` | – | Shows Hide once everything is done. |
| `defaultCollapsed` | `boolean` | `false` | Start folded to the header. |

## States

- **next**: The first open task is expanded with its description and action, on a soft tint.
- **doing**: A spinner opens in the button and its label morphs to pendingLabel while your promise runs.
- **ticked**: The ring blurs into a filled circle and its check draws (380ms); a strike draws through the label (480ms); this task folds and the next opens (420ms). The ring advances and the count rolls.
- **picked**: Clicking any row opens it, done or not; finishing a task returns to the next open one.
- **folded**: The chevron folds the list to the header, which keeps the ring and count.
- **done**: The list folds, the ring fills and a primary disc grows over it with a check drawing itself, ten dots burst outward (700ms), the title morphs to doneTitle and Hide fades in.

## What it handles

A checklist is the first thing a new customer sees, and most are a static list of links. This one opens the next task in place and can run its action right there.

- **The next task is open**: It shows what the task is, why it matters and the one button that does it.
- **Actions run in place**: onClick can return a promise. The button shows a spinner and a pending label, and a failure leaves the task open to try again.
- **Progress is visible**: A ring fills a step at a time and “2 of 5” rolls.
- **Finished tasks can be revisited**: Click any row to open it, done or not.
- **Progress survives a reload**: Pass done from your database, and mark tasks done as their actions land with onTaskComplete.
- **A finish worth seeing**: The list folds away, the ring becomes a check with a small burst, and the title reads “You’re all set”.

## Replaces

a setup checklist, a progress ring, expand and collapse, pending button states, a completion state

## Where it fits

- **SaaS “Get started” cards**: The first five things a new customer should do, on the dashboard.
- **Developer platforms**: Create an API key, install the SDK, make a first request.
- **Seller and creator onboarding**: Add a product, connect payouts, publish a page.
- **Team setup**: Invite teammates, connect integrations, finish the profile.

## Notes

- An ordered list of disclosure buttons, each with aria-expanded; done tasks say so to screen readers. Progress is announced politely ("3 of 5 done") and once more when all is done.
- The action button stays focusable while it runs and is marked aria-busy; a rejected promise leaves the task open to try again.
- Folded parts are inert, so the keyboard never lands inside them.
- Installs Number roll and Text morph. With reduced motion, ticks, strikes and the finish change in place without the burst.

License: MIT (https://hairlineui.com/license#components)
