Updated
Setup Checklist
NewCustomize
Duration0.60s
Installation
npx shadcn@latest add https://uibrik.com/r/setup-checklist.jsonInstall the packages
npm install @tabler/icons-react motionAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/setup-checklist/setup-checklist.tsx"use client"; import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from "react"; import { AnimatePresence, LayoutGroup, animate, motion, useReducedMotion } from "motion/react"; import { IconChevronDown } from "@tabler/icons-react"; import { cn } from "@/lib/utils"; // Setup checklist. An onboarding list beside a progress ring with one segment // per task. Finishing a task plays one gesture: its check draws, the row folds // away, and a dot lifts off the check and flies along a curve into the ring, // where its segment fills and the count rolls on. When the last dot lands the // segments close into one ring, the list folds away and the card settles into // a "You're all set" state with a check drawn inside the ring. // // Finished tasks wait under "Done", where unticking one brings it back (its // segment drains) so a slip is never final. export type SetupTask = { id: string; title: string; description?: string; /** A button on the row, e.g. to start the task. */ action?: { label: string; onClick?: () => void }; };
Adds the files to
components/uibrik/setup-checklist and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/setup-checklist.Usage
import { SetupChecklist } from "@/components/uibrik/setup-checklist/setup-checklist";const tasks = [ { id: "project", title: "Create a project", description: "Name it and pick a region", action: { label: "Create" } }, { id: "team", title: "Invite your team", description: "Add people by email or link", action: { label: "Invite" } }, // …3 more];<SetupChecklist title="Get started" doneTitle="You're all set" duration={0.6} tasks={tasks} defaultValue={["project"]} doneDescription="Everything is ready to go." onComplete={() => {}} // value={["…"]} // onValueChange={(done) => {}}/>Where to use Setup Checklist
Product onboarding
New accounts see what's left to set up, and every step they finish visibly counts.
Workspace setup
Invite, connect and configure steps sit in one card that folds away once done.
Pairs with Invite Members
Launch checklists
Pre-launch tasks fill the ring one by one, with finished ones kept under Done to reopen.
Props
SetupChecklist- title
- Type string
- "Get started"
- The card's heading.
- doneTitle
- Type string
- "You're all set"
- Shown once everything is done.
- duration
- Type number
- 0.6
- How long the dot takes to fly into the ring.
- tasks
- Type { id; title; description?; action? }[]
- –
- The steps. action adds a button to the row, e.g. { label: "Invite", onClick }.
- value / onValueChange
- Type string[] / (done) => void
- –
- Finished task ids, controlled.
- defaultValue
- Type string[]
- –
- Finished task ids on mount, uncontrolled.
- onComplete
- Type () => void
- –
- Called once when the last task is finished.
- doneDescription
- Type string
- "Everything is ready to go."
- The line under the done title.
- className
- Type string
- –
- Classes for the card.