Skip to content

Checklist

The steps to get something ready, and how many are done. Each step says what to do and has its way to do it; with onToggle the person marks steps themselves.

import { Checklist, ChecklistSkeleton } from '@sypnia/ui/react'

On this page
  1. Getting a project ready
  2. In Astro
  3. Skeleton
  4. When to use it
  5. For everyone
  6. Props

Getting a project ready

Get your project ready

1 of 4 done
  1. Add the SDK to your app
  2. Connect a databaseThe agent reads your tables to explain errors.
  3. Invite your teamEveryone sees the same errors and fixes.
  4. Choose where alerts go
Code
import { useState } from 'react';
import { Button, Checklist, LinkButton } from '@sypnia/ui/react';

// The steps to get a project ready. Each has its way to do it; the person can also mark them.
export default function Setup() {
  const [done, setDone] = useState<string[]>(['sdk']);
  const toggle = (id: string, on: boolean) => setDone((d) => (on ? [...d, id] : d.filter((x) => x !== id)));
  return (
    <Checklist title="Get your project ready" onToggle={toggle} items={[
      { id: 'sdk', title: 'Add the SDK to your app', done: done.includes('sdk') },
      { id: 'db', title: 'Connect a database', description: 'The agent reads your tables to explain errors.', done: done.includes('db'), action: <Button size="sm" onClick={() => toggle('db', true)}>Connect</Button> },
      { id: 'team', title: 'Invite your team', description: 'Everyone sees the same errors and fixes.', done: done.includes('team'), action: <LinkButton size="sm" href="#team">Invite</LinkButton> },
      { id: 'alert', title: 'Choose where alerts go', done: done.includes('alert') },
    ]} />
  );
}

In Astro

Publish your docs

1 of 3 done
  1. Connect the repository
  2. Add your domainYour docs live at docs.your-domain.com.
  3. Turn on search
Code
---
// The Astro twin: steps with links to where each is done. It shows progress; marking steps needs the React piece.
import Checklist from '@sypnia/ui/astro/Checklist.astro';
---
<Checklist title="Publish your docs" items={[
  { id: 'repo', title: 'Connect the repository', done: true },
  { id: 'domain', title: 'Add your domain', description: 'Your docs live at docs.your-domain.com.', href: '#domain', action: 'Add a domain' },
  { id: 'search', title: 'Turn on search', href: '#search', action: 'Turn on' },
]} />

Skeleton

Code
import { ChecklistSkeleton } from '@sypnia/ui/react';

// The checklist while its steps load.
export default function Skeleton() {
  return <ChecklistSkeleton items={3} />;
}

When to use it

Use it when

  • Setting up a project, preparing a release.

Do not use it when

  • Steps that must be done in one sitting: use Wizard.

For everyone

  • Each mark is a toggle named after its step: «Mark Connect a database as done».
  • The count says how many are done, in words.

Props

ChecklistTypeDefault
itemsrequired ChecklistItem[]
titlerequired ReactNode
onToggle ((id: string, done: boolean) => void)
ChecklistSkeletonTypeDefault
items number 4
  1. Getting a project ready
  2. In Astro
  3. Skeleton
  4. When to use it
  5. For everyone
  6. Props

    Search pages, sections and terms