Step Invalidation

Says which later wizard answers an earlier change will clear before it applies, then walks back through only those steps.

StopsEarlier wizard change broke later steps

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/step-invalidation.json

The files land in your project. They're yours to edit.

Usage

step-invalidation-usage.tsx
import { StepInvalidationNav, StepInvalidationNotice, StepInvalidationRail, invalidatedFieldClass, useStepInvalidation, type WizardStep, } from "@/components/ui/step-invalidation"

<StepInvalidationNav wizard={wizard} onFinish={() => setFinished(true)} />

What it catches

  • Later answers a change would clear or trim, grouped by step
  • Steps needing review, marked in the stepper
  • Finish attempted before affected steps are checked
  • Changing the answer back, which restores what was removed

Props

StepInvalidationRail props
PropTypeDefault
wizard* (required)

The wizard state returned by the hook.

Wizard<T>—
staleHint

Read after a step that needs another look.

string"needs another look"

* required. Also accepts the native props of <ol> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Stepper buttons use aria-current="step" and aria-labels that include the stale hint
  • Impact message is role=status (polite)
  • Keep, change and review are labelled buttons; icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Dependencies are what you declare in the wizard config
  • Restore works within the session; it isn't persisted

What it stops

Earlier wizard change broke later steps

Also known as

wizard · stepper · multi-step form · onboarding · plan selection · dependent steps · configurator

Dependencies

Pairs well with