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'
Getting a project ready
Get your project ready
1 of 4 done- Add the SDK to your app
- Connect a databaseThe agent reads your tables to explain errors.
- Invite your teamEveryone sees the same errors and fixes.
- 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- Connect the repository
- Add your domainYour docs live at docs.your-domain.com.
- 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
| Checklist | Type | Default |
|---|---|---|
itemsrequired | ChecklistItem[] | |
titlerequired | ReactNode | |
onToggle | ((id: string, done: boolean) => void) |
| ChecklistSkeleton | Type | Default |
|---|---|---|
items | number | 4 |