1.1k
Sponsor

Setup Flow

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

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/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"

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Arrow keys move inside the composite; Home / End select the first or last enabled item; Enter / Space activate, select, or toggle; Escape cancels or closes an owned surface; Tab / Shift+Tab move between termcn/Ink focus targets.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Ink labels and semantic state expose the component without relying on visual styling alone.