API Reference
Props Full prop reference for the FormWizard component and FormWizard.TabContent.
Prop Description Sample titleWizard title (string or React node). A node replaces the whole header. v1 basic subtitleOptional wizard subtitle text. v1 basic childrenChildren API content using FormWizard.TabContent. v1 basic schemaSchema API definition (FormWizardSchema). If both schema and children are passed, schema wins. v1 schema api dataControlled wizard data object. v1 conditional steps onDataChangeCallback fired when wizard data changes. v1 schema api
Prop Description Sample variant v2 Visual skin: "modern" (default) or "legacy" for the v1 appearance. theming colorScheme v2 "auto" (default), "light" or "dark". Pins the scheme instead of following the OS or your .dark class.dark mode colorMain accent colour. Prefer theme.primaryColor — color is an inline style and cannot be overridden by CSS. v1 custom colors theme v1.2 Theme tokens written as --rfw-* CSS custom properties on the root. Overrides one value without restating a palette. theming unstyled v1.2 Drops every bundled class and inline colour so only your own styles apply. Default: false. unstyled classNames v1.2 Per-element class overrides (WizardClassNames). Merged with the defaults, or replacing them when unstyled. unstyled shapeTab shape (circle, square or tab). v1 square shape stepSizeStep size: xs, sm, md, lg. Default: md. v1 step sizes layoutLayout direction: horizontal or vertical. Default: horizontal. v1 vertical layout showProgressBarToggle the progress bar between completed steps. Default: true. v1 progress bar inlineStepCompact inline step layout. Default: false. v1 inline steps darkModeEnables dark mode visuals. Default: false. v1 dark mode customDarkModeColorCustom dark-mode colour tokens object. Prefer theme, which works in both light and dark. v1 dark mode removeBackgroundTabRemoves the default tab background fill. legacy remove tab bg removeBackgroundTabTransparentColorBackground colour to apply under transparent tab icons. legacy remove tab bg style v1.2 Extra inline styles for the root element. —
Prop Description Sample startIndexInitial active step index. Clamped into range on the first render. legacy step index disableBackOnClickStepPrevents navigating by clicking step markers. v1 complete showcase persist v1.2 { key, storage } — keeps wizard data across reloads. storage is "session" (default) or "local".persistence syncToUrl v1.2 true or { param } — mirrors the active step into a query parameter (1-based). Default param: step.persistence keyboardNavigation v1.2 Enable ← → Home End navigation. Default: true. accessibility swipeNavigation v1.2 Enable horizontal swipe on touch devices. Default: true. accessibility
Prop Description Sample announceStepChanges v1.2 Announce step changes through an aria-live region and move focus to the revealed panel. Default: true. accessibility ariaLabel v1.2 Accessible name for the wizard region. Default: "Form Wizard". Give each wizard its own when a page has several. accessibility
Prop Description Sample onCompleteCalled on finish, with the wizard data: (data?: WizardData) => void. v1 schema api onTabChangeCalled when the active step changes with { prevIndex, nextIndex, stepId? }. Does not fire on mount as of v1.2. events
Used to define each step in the children API:
Prop Description Sample idStable step id, used by goToTabById and reported as stepId. v1 complete showcase titleTab title text. v1 basic iconTab icon (class-name string or React node). v1 custom react icons conditionCondition function deciding whether the step is visible. v1 conditional steps validateValidation function returning true, false, or an error message string. validation isValidStatic boolean validity flag. Prefer validate for anything data-dependent. v1 validation validationErrorCalled when an invalid step blocks navigation. v1 validation showErrorOnTabShows the error style on the tab when invalid. v1 validation showErrorOnTabColorError colour for the tab icon, title and progress border. v1 validation
Each entry in schema.steps accepts:
Option Type Description idstringStable step id. titlestringStep label. iconstring | ReactNodeIcon class name or node. contentReactNode | (ctx) => ReactNodeStep body, or a function of the current data. condition(ctx) => booleanHide the step when it returns false. validate(ctx) => true | string | falseBlock navigation; a string is the message shown. showErrorOnTabbooleanMark the step marker on failure. showErrorOnTabColorstringColour used to mark it.
validate runs on every render , so it must be synchronous and free of side
effects — never await, never set state from it. For asynchronous checks, do
the work in your own handler, write the result into wizard data, and have the
validator read that. See the
async verification pattern .
theme accepts any subset of these; anything omitted falls back to the
stylesheet default.
Token CSS custom property primaryColor--rfw-primarybackgroundColor--rfw-bgbackgroundColor--rfw-bgtextColor--rfw-texttitleColor--rfw-titlesubtitleColor--rfw-subtitletabColor--rfw-tabtabIconColor--rfw-tab-iconborderColor--rfw-borderbuttonColor--rfw-buttonbuttonTextColor--rfw-button-textfinishButtonColor--rfw-finish-buttonfinishButtonTextColor--rfw-finish-button-texterrorColor--rfw-errorborderRadius--rfw-radius
root, header, title, subtitle, navigation, stepList, step,
stepActive, stepIcon, stepTitle, content, footer, backButton,
nextButton, finishButton.
import type {
FormWizardProps,
FormWizardMethods,
FormWizardSchema,
WizardStepSchema,
WizardData,
WizardTheme,
WizardClassNames,
WizardPersistOptions,
WizardUrlSyncOptions,
WizardStepChangeEvent,
WizardCondition,
WizardValidation,
WizardValidationResult,
WizardConditionContext,
WizardValidationContext,
UseWizardOptions,
UseWizardReturn,
TabContentProps,
} from "react-form-wizard-component" ;
Releases 1.0.0–1.1.1 pointed types at a file that was never generated, so
TypeScript reported TS7016: Could not find a declaration file. That is fixed,
and type resolution is now verified in CI under bundler, node16 and
node10.
For callback details see Events ; for imperative methods see
References .