362
Sponsor

Setup Flow

@clack-style step flow with ◇/◆/│ visual language, badge, info steps, and multi-select

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/setup-flow

Usage

import { SetupFlow } from "@/components/ui/setup-flow";
<SetupFlow title="create-app">
  <SetupFlow.Badge label="v1.0.0" />
  <SetupFlow.Step status="done">Project name set to my-app</SetupFlow.Step>
  <SetupFlow.Step status="done">Template selected: React</SetupFlow.Step>
  <SetupFlow.Step status="active">Installing dependencies...</SetupFlow.Step>
  <SetupFlow.MultiSelect
    label="Select features"
    hint="space to toggle, enter to confirm"
    options={[
      { value: "ts", label: "TypeScript" },
      { value: "eslint", label: "ESLint", description: "Code linting" },
      { value: "prettier", label: "Prettier", description: "Formatting" },
    ]}
    onSubmit={(values) => console.log(values)}
  />
</SetupFlow>

API Reference

SetupFlow

PropTypeDefault
titlestring-
titleFont"block" | "simple" | "shade" | "slim""block"
titleColorstring"#888888"
titleColorAltstring-
connectorCharstring"│"
connectorColorstring-
childrenReactNoderequired

SetupFlow.Badge

PropTypeDefault
labelstringrequired
bgstring"cyan"
colorstring"black"

SetupFlow.Step

PropTypeDefault
iconstring-
iconColorstring-
status"done" | "active" | "pending" | "success" | "error""done"
childrenReactNoderequired

SetupFlow.Spinner

PropTypeDefault
labelstringrequired
onComplete() => void-

SetupFlow.MultiSelect

PropTypeDefault
labelstringrequired
hintstring-
options{ value: string; label: string; description?: string }[]required
valuesstring[]-
onChange(values: string[]) => void-
onSubmit(values: string[]) => void-
checkedCharstring"■"
uncheckedCharstring"□"
checkedColorstring"green"