Loading component…
Loading component…
Onboarding panel with a progress bar and collapsible task groups that strike through when done
To reuse this local React demo, copy all files from the Code tab into the same folder, then import SetupGuide from ./setup-guide.
import { SetupGuide } from "@/components/ui/setup-guide";
const groups = [
{
id: "workspace",
title: "Set up your workspace",
tasks: [
{ id: "name", label: "Choose a workspace name" },
{ id: "invite", label: "Invite your teammates" },
],
},
{ id: "verify", title: "Verify your account", tasks: [{ id: "email", label: "Confirm your email", done: true }] },
];
export function Onboarding() {
return <SetupGuide groups={groups} onChange={save} onClose={hideGuide} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| groups | SetupGroup[] | Groups with an id, a title and tasks; each task has an id, a label and an optional done flag | |
| title | string | "Setup guide" | Heading above the bar |
| onEdit | () => void | Shows an Edit link in the header | |
| onClose | () => void | Shows a close button in the header | |
| onChange | (done: string[]) => void | Called with the ids of all finished tasks | |
| className | string | Extra class on the panel |
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"