Introduction
Installation
Next.jsViteLaravelReact RouterRemixAstroTanStack StartTanStack RouterManual InstallationMCP
All componentsTheme
FieldFormInputText FieldTextareaSearch FieldInput OTPNumber FieldNumber FormatSliderCheckboxSwitchRadioSelectCombo BoxList BoxChoice BoxMulti SelectToken FieldNewTag FieldTag GroupCalendarDate FieldDate PickerDate Range PickerRange CalendarTime FieldColor PickerColor FieldColor AreaColor SliderColor SwatchColor Swatch PickerColor ThumbColor WheelDrop ZoneFile Trigger
ButtonButton GroupToggleToggle GroupPreskok Auth Button
EditorHeadingLinkTextKeyboard
CardContainerGrid ListResizableTableFilter BarNewTreeSeparatorDescription ListScroll AreaShow MoreToolbar
BreadcrumbsNavbarPaginationTabsWizardSidebar
DialogModalPopoverPreview TriggerNewSheetTooltipContext MenuDropdownCommandCommand MenuDisclosureMenu
ToastProgress BarProgress ListProgress CircleMeterLoaderSkeletonNoteBadge
ChartArea ChartBar ChartLine ChartPie ChartRadial ChartRadar ChartBar ListTrackerRecharts ChartsDeprecated
Async ImageAvatarCarouselPreskok Icon
Navigation

Wizard

Guides people through a multi-step flow one step at a time, with a step list, panels and previous/next buttons.

View as MarkdownAsk ChatGPT

A wizard moves people forward one step at a time and lets them go back to earlier steps. Going back makes the current step the furthest one again, unless you track progress with completedKeys. To only show progress without navigation, use a Progress List.

Gated steps

Pass completedKeys to decide when a step is done, for example once its fields are valid. People can reach every enabled step up to and including the first enabled step after the last completed one, including earlier steps that are not completed yet. The next button stops there, so compute completedKeys in order, as the example does. Without completedKeys, every step before the current one counts as completed. Set allowsSelectingIncompleteSteps to make every enabled step reachable at any time. In that mode no step counts as completed unless you pass completedKeys.

Installation

npx shadcn@latest add @preskok/wizard

Usage

import { Button } from "@/components/ui/preskok-ui/button"
import {
  Wizard,
  WizardButtons,
  WizardPanel,
  WizardPanels,
  WizardStep,
  WizardStepList,
} from "@/components/ui/preskok-ui/wizard"

const steps = [
  { id: "account", label: "Account", content: <AccountForm /> },
  { id: "billing", label: "Billing", content: <BillingForm /> },
  { id: "review", label: "Review", content: <Summary /> },
]

export function Signup({ onCreate }: { onCreate: () => void }) {
  return (
    <Wizard>
      <WizardStepList aria-label="Sign up" items={steps}>
        {(step) => <WizardStep>{step.label}</WizardStep>}
      </WizardStepList>
      <WizardPanels items={steps}>
        {(step) => <WizardPanel>{step.content}</WizardPanel>}
      </WizardPanels>
      <WizardButtons
        finish={<Button onPress={onCreate}>Create account</Button>}
      />
    </Wizard>
  )
}

WizardButtons renders buttons in the previous and next slots. They move between steps and are disabled when there is no step to move to. On the last step, finish replaces the next button. Trailing steps disabled with isDisabled or the Wizard's disabledKeys are skipped when finding the last step. Panels unmount when their step is not selected, so keep form values in state above the Wizard. You can also place your own <Button slot="previous"> and <Button slot="next"> anywhere inside the Wizard. When Next turns into the finish action on the last step, focus moves to the current step in the step list.

Each step id must match a WizardPanel id. Steps support isDisabled and description, and orientation="vertical" puts the step list beside the panels. WizardStateContext exposes the current, previous and next keys to custom controls.

Tabs

A tabs component with accessible tab navigation.

Sidebar

A composable, themeable, and customizable React Aria sidebar.

On this page

Gated steps
Installation
Usage
List a vehicle
Dealers see the listing as soon as it is published.
1Vehicle
Not completed 2Photos
Not completed 3Price
Not completed 4Review
Make
0/17 characters. Letters I, O and Q are not used.

Fill in the required fields to continue.

Become a dealer
Four short steps. You can go back and change anything before submitting.
1CompanyLegal details
Not completed 2BillingVAT and invoices
Not completed 3ContactWho we talk to
Not completed 4ReviewCheck and submit
Country

Fill in the required fields to continue.