Skip to content

Setup Wizard

A multi-step setup on the Stepper: validation before Next, Back, Skip for optional steps, a review step, a final success state and focus on the step heading. Each step is a form, so Enter in a field moves on. Works in a page or in a dialog.

On this page
Used for
  • Workspace setup flow
  • Model and key configuration
  • Multi-step onboarding
  • Review then finish form
  • Resumable setup by URL

Examples

In a dialog

Installation

npx knowns-ui@latest add setup-wizard
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

steps
{ id, title, description?, optional?, validate?, children }[]
`validate` returns a message to stay on the step (sync or async). `optional` adds Skip and the stepper's Optional label.
review
{ title?, description?, children }
A screen after the last step. Its Next button reads `finishLabel`.
success
{ title, description?, action? }
Shown after `onFinish` resolves. Focus moves to its heading.
onFinish
() => void | Promise<void>
Runs on the last screen. The button shows a spinner while it works.
current / defaultCurrent / onCurrentChange
number
Default0
Controlled or uncontrolled step index. The review screen is index `steps.length`.
syncUrl
string
A query parameter name, e.g. "step". Keeps `?step=<id>` in the address bar (replaceState) and reads it on load.
variant
"card" | "plain"
Default"card"
Plain drops the border and padding, for a dialog or your own panel.
finishLabel
string
Default"Finish"
The last button's label.

Next stays put and shows a red message (role="alert") when a step fails; the step turns red in the stepper. Finished steps in the stepper take you back. On narrow containers the stepper turns vertical.

What it handles

  1. 01Shows one step at a time under a Stepper, horizontal from 34rem of container width and vertical below it, with finished steps clickable to go back.
  2. 02Runs the step's `validate`, sync or async, on Next, stays put with an alert under the fields when it returns a message, and marks that step with an error.
  3. 03Submits each step as a form, so Enter in a field moves on, and sends focus to the step heading on every change but the first render.
  4. 04Marks a step `optional` to show Optional in the stepper and a Skip button, and keeps Back disabled on the first step.
  5. 05Adds a review screen after the last step with `review`, whose Next button reads `finishLabel`, then awaits `onFinish` with a spinner before the success screen.
  6. 06Runs controlled with `current` and `onCurrentChange` or on its own, and `syncUrl="step"` keeps ?step=<id> in the address bar and reads it on load.

States

First render
Nothing. The first step paints as it is, with no focus move
none
Next or Back
The step panel swaps and focus moves to its heading
none
Validation fails
An alert with the message appears and the step stays
none
Finish
The button spins while onFinish runs, then the success text replaces the form
none
Stepper marks
The stepper updates its own marks and lines
none

Works with

When to use

When to use

  • A setup with several dependent steps, like connecting an account: validate, review, then confirm.
  • The same flow in a page or inside a dialog.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Setup Wizard to my app and wire it to my own data.
  • I need a setup with several dependent steps, like connecting an account: validate, review, then confirm. Set that up with the Knowns UI Setup Wizard.
  • Which Setup Wizard props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "setup-wizard" }) and search_docs({ query: "setup wizard" }).

Need help?

Stuck on Setup Wizard, or found something off? We read every message.