# React Native Onboarding Checklist (Pro)

> A React Native onboarding checklist for iOS, Android and the web, like Stripe's and Notion's Get started card: a progress ring, the next task highlighted with its button, done tasks struck through, confetti when the last one lands, collapsible and dismissible. Part of Patine Pro.

# Onboarding checklist Pro

`OnboardingChecklist` is the **Get started** card of a new account, as in Stripe, Notion and Linear: a ring that fills as tasks are done, the next task highlighted with its button, finished ones checked and struck through, and confetti when the last one lands. It folds down to its header and can be dismissed.

You own the tasks and their `done`: the checklist reflects what's true in your app, so a task done elsewhere (an invite sent from Settings) checks itself.

```tsx
import { OnboardingChecklist } from '@patine-ui/pro';
```

```tsx live
import { useState } from 'react';
import { OnboardingChecklist } from '@patine-ui/pro';

const TASKS = [
  { id: 'workspace', title: 'Create your workspace', done: true },
  { id: 'invite', title: 'Invite your team', description: 'Projects move faster with two. Invite by email or share a link.', actionLabel: 'Invite people' },
  { id: 'github', title: 'Connect GitHub', description: 'Link pull requests to issues, and close them on merge.', actionLabel: 'Connect' },
  { id: 'issue', title: 'Create your first issue', description: 'Press C anywhere.', actionLabel: 'New issue' },
  { id: 'cycle', title: 'Plan a cycle', description: 'Two weeks of work, with a start and an end.', actionLabel: 'Plan' },
];

export default function Example() {
  const [done, setDone] = useState(['workspace']);
  const [visible, setVisible] = useState(true);
  if (!visible) return null;
  return (
    <OnboardingChecklist
      title="Get started with Acme"
      items={TASKS.map((t) => ({ ...t, done: done.includes(t.id), onPress: () => setDone((d) => [...d, t.id]) }))}
      onDismiss={() => setVisible(false)}
      style={{ maxWidth: 420 }}
    />
  );
}
```

Press each task's button to see the ring fill, and the card celebrate when the last one is done.

## Example: open an online store

A new shop owner's home screen: each step opens the screen that does it, and here it finishes after a moment as if the owner did it there. When all four are done the checklist celebrates.

```tsx live
import { useState } from 'react';
import { Text, VStack } from 'patine-ui';
import { OnboardingChecklist } from '@patine-ui/pro';

const STEPS = [
  { id: 'product', title: 'Add your first product', description: 'A title, a photo and a price is enough to start.', actionLabel: 'Add product' },
  { id: 'theme', title: 'Pick a theme', description: 'Three free themes, all editable later.', actionLabel: 'Browse themes' },
  { id: 'payments', title: 'Set up payments', description: 'Cards, Apple Pay and iDEAL. Payouts every two days.', actionLabel: 'Set up' },
  { id: 'domain', title: 'Connect a domain', description: 'Use one you own, or buy one for €12 a year.', actionLabel: 'Add domain' },
];

export default function Example() {
  const [done, setDone] = useState<string[]>(['product']);
  const [working, setWorking] = useState('');
  const finish = (id: string) => {
    setWorking(id);
    setTimeout(() => {
      setDone((d) => [...d, id]);
      setWorking('');
    }, 900);
  };
  return (
    <VStack gap="sm" style={{ width: '100%', maxWidth: 440 }}>
      <OnboardingChecklist
        title="Open Juniper & Co."
        description="Your store goes live when these are done."
        items={STEPS.map((s) => ({ ...s, done: done.includes(s.id), onPress: () => finish(s.id) }))}
      />
      {working ? <Text size="sm" color="textSecondary">Opening {STEPS.find((s) => s.id === working)?.title.toLowerCase()}…</Text> : null}
    </VStack>
  );
}
```

## In a sidebar or a home screen

It fits a 300-point sidebar and a phone's home screen alike. Start it folded with `defaultOpen={false}` where space is tight; the header still shows the ring and how many are left.

```tsx live
import { OnboardingChecklist } from '@patine-ui/pro';

export default function Example() {
  return (
    <OnboardingChecklist
      defaultOpen={false}
      celebrate={false}
      items={[
        { id: 'a', title: 'Add a payment method', done: true },
        { id: 'b', title: 'Verify your business', done: true },
        { id: 'c', title: 'Create your first product' },
      ]}
      style={{ maxWidth: 320 }}
    />
  );
}
```

## Accessibility

- Each task is a checkbox with its state, read with its description.
- The header reads "Get started, 2 of 5 done" and folds the list; the close button reads "Dismiss".
- The check pops and the ring fills; with reduce motion on, they're shown at once and no confetti flies.

## Props

| Prop | Type | Default |
| --- | --- | --- |
| `items` | `{ id, title, description?, done?, actionLabel?, onPress? }[]` | |
| `title` | `string` | `'Get started'` |
| `description` | `string` | "3 steps left" |
| `defaultOpen` | `boolean` | `true` |
| `onDismiss` | `() => void`: shows the close button | |
| `celebrate` | `boolean`: confetti on the last task | `true` |
| `style` | `ViewStyle` | |

## Related

- [Product tour](./product-tour): the walk-through before the tasks.
- [Motion effects](./motion): the `Confetti` it throws.
- [Progress](./progress): a plain bar, free.
