npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-wizard.json --yesWizard
ProA flow the user goes through one step at a time, with back and next buttons, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- WizardHeaderThe step strip at the top of a wizard, naming each step
- WizardPanelOne step's content (title, description, fields)
- WizardFooterThe row for WizardPrevious and WizardNext
- WizardPreviousThe back button, first in WizardFooter
- WizardNextThe forward button, last in WizardFooter
- WizardIndicatorThe flow's overall progress as a compact header, IN PLACE OF the
WizardHeader(one or the other, never both)
import { Wizard, WizardHeader, WizardPanel, WizardFooter, WizardPrevious, WizardNext, WizardIndicator } from '@/components/ui/goop/wizard';
import { useState } from 'react';
import { Alert, AlertTitle } from '@/components/ui/goop/alert';
import { Field } from '@/components/ui/goop/field';
import { TextInput } from '@/components/ui/goop/text-input';
function ImportFlow() {
const [step, setStep] = useState('file');
const [file, setFile] = useState('');
const [tried, setTried] = useState(false);
return (
<Wizard
aria-label="Import notes"
steps={[
{ value: 'file', label: 'File', complete: file !== '' },
{ value: 'check', label: 'Check' },
]}
value={step}
onValueChange={setStep}
>
<WizardHeader label="Import steps" />
<WizardPanel
value="file"
title="Choose a file"
alert={tried && !file ? <Alert variant="destructive"><AlertTitle>Name a file to import</AlertTitle></Alert> : null}
>
<ul>
<Field as="li" label="File name">
<TextInput value={file} onChange={(event) => setFile(event.target.value)} aria-invalid={tried && !file} />
</Field>
</ul>
</WizardPanel>
<WizardPanel value="check" title="Check the notes" description="Each file becomes one note." />
<WizardFooter>
<WizardPrevious />
<WizardNext
finishLabel="Import"
onClick={(event) => {
if (step !== 'file' || file) return;
event.preventDefault();
setTried(true);
}}
/>
</WizardFooter>
</Wizard>
);
}Make a workspace in three steps. Continue with an empty name, a malformed address or a taken one (fieldwork, team, home) is refused with the reason on the step; a wrong email on the second step too. Back keeps what was typed; Create saves for a moment and ends on a finished state; Start again. Switch the head to the compact progress row. The taken addresses are a list of three and the save is a timer; nothing is created or sent.
When to use
- A flow the user goes through one step at a time, with back and next buttons.
- Also called: multi-step form or stepper.
When not to use
- To only show where someone is in a flow, use Steps.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Wizard on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-wizard.json --yesAdd the Goop Wizard to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { Wizard, WizardHeader, WizardPanel, WizardFooter, WizardPrevious, WizardNext, WizardIndicator } from '@/components/ui/goop/wizard';
import { useState } from 'react';
import { Alert, AlertTitle } from '@/components/ui/goop/alert';
import { Field } from '@/components/ui/goop/field';
import { TextInput } from '@/components/ui/goop/text-input';
function ImportFlow() {
const [step, setStep] = useState('file');
const [file, setFile] = useState('');
const [tried, setTried] = useState(false);
return (
<Wizard
aria-label="Import notes"
steps={[
{ value: 'file', label: 'File', complete: file !== '' },
{ value: 'check', label: 'Check' },
]}
value={step}
onValueChange={setStep}
>
<WizardHeader label="Import steps" />
<WizardPanel
value="file"
title="Choose a file"
alert={tried && !file ? <Alert variant="destructive"><AlertTitle>Name a file to import</AlertTitle></Alert> : null}
>
<ul>
<Field as="li" label="File name">
<TextInput value={file} onChange={(event) => setFile(event.target.value)} aria-invalid={tried && !file} />
</Field>
</ul>
</WizardPanel>
<WizardPanel value="check" title="Check the notes" description="Each file becomes one note." />
<WizardFooter>
<WizardPrevious />
<WizardNext
finishLabel="Import"
onClick={(event) => {
if (step !== 'file' || file) return;
event.preventDefault();
setTried(true);
}}
/>
</WizardFooter>
</Wizard>
);
}- Fits: flow (its recipe).
- To refuse a move (Continue pressed while the step has errors), call
event.preventDefault()inWizardNext'sonClick: the step stays, neitheronValueChangenoronFinishis called, and that press shows why, in the step'salertand witharia-invalidon each refused field. When the flow can open at any step (a link, a saved draft, an Edit button), give eachstepsentrycompletefrom what was filled, or every earlier step reads as done. A controlled wizard also stays put when itsonValueChangedoes not pass the new value back. - width, padding, gap, corner, border: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| steps | ReadonlyArray<WizardStep> | The flow as data, in order: each step's value, its label and complete. |
| value? | string | The current step's value, when the caller holds it (with onValueChange). |
| defaultValue? | string | The step shown first when the caller does not hold it. |
| onValueChange? | (value: string) => void | Hears every move with the new step's value; a controlled wizard moves only when its caller passes it. |
- State: value (value / defaultValue / onValueChange)
- Types: WizardStep = { value: string; label: string; complete?: boolean }
| Part | What it is |
|---|---|
| WizardHeader | The step strip at the top of a wizard, naming each step; use it or WizardIndicator, never both; its props: wizard--header.md |
| WizardPanel | One step's content (title, description, fields); write one per step, matched to it by value; its props: wizard--panel.md |
| WizardFooter | The row for WizardPrevious and WizardNext; write it once, as a direct child of the Wizard; its props: wizard--footer.md |
| WizardPrevious | The back button, first in WizardFooter; it goes one step back and hides on the first step; its props: wizard--previous.md |
| WizardNext | The forward button, last in WizardFooter; on the last step it finishes the flow; its props: wizard--next.md |
| WizardIndicator | The flow's overall progress as a compact header, IN PLACE OF the WizardHeader (one or the other, never both); its props: wizard--indicator.md |
WizardHeader
The step strip at the top of a wizard, naming each step; use it or WizardIndicator, never both.
import { WizardHeader } from '@/components/ui/goop/wizard';Options
- label?: string = 'Steps' — The strip's name, read by assistive technology.
- className?: string — Classes added to the header's column, the strip and the children.
- children?: ReactNode — What follows the strip: the caller's own (never a
WizardIndicator, which stands in place of the header).
WizardIndicator
The flow's overall progress as a compact header, IN PLACE OF the WizardHeader (one or the other, never both).
import { WizardIndicator } from '@/components/ui/goop/wizard';Options
- label?: string = 'Progress' — The bar's name, read by assistive technology.
- className?: string — Classes added to the row holding the caption and the bar.
- children?: string — The caption's words; "2/4" by default.
WizardNext
The forward button, last in WizardFooter; on the last step it finishes the flow.
import { WizardNext } from '@/components/ui/goop/wizard';Options
- finishLabel?: ReactNode = 'Finish' — The forward button's words on the last step.
- onFinish?: () => void — Called by a press on the last step, which moves nothing.
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void — Runs first on a press;
event.preventDefault()in it keeps the step (a step with errors). - Also takes: type?: 'button' | 'submit' | 'reset' = 'button'; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'
WizardPanel
One step's content (title, description, fields); write one per step, matched to it by value.
import { WizardPanel } from '@/components/ui/goop/wizard';Options
- value: string — The step this panel shows: a
valueof the wizard'ssteps. - title: ReactNode — The step's title, a heading that names the panel.
- headingLevel?: 2 | 3 | 4 | 5 | 6 = 3 — The title's heading level, one under the heading the wizard stands under.
- description?: ReactNode — A line under the title.
- alert?: ReactNode — The caller's
Alertbefore the fields: what needs a change before the step is left. - className?: string — Classes added to the panel round the step's card.
- children?: ReactNode — The step's fields: a list of the theme's
Fieldrows.
WizardPrevious
The back button, first in WizardFooter; it goes one step back and hides on the first step.
import { WizardPrevious } from '@/components/ui/goop/wizard';Options
- Also takes: type?: 'button' | 'submit' | 'reset' = 'button'; onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'
Keyboard
| Key | What it does |
|---|---|
| Tab | Move through the step's fields and the foot's buttons |
| Enter | Press the focused button |
Accessibility
- The part itself answers the keys above.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.