Introducing PrimeReact v11-alpha 🎉Discover Now

Stepper

An unstyled, accessible stepper component with compound composition for multi-step workflows.

Build fully custom step-by-step workflows with complete control over layout and styling.

Content I
basic-demo

Pre-styled Versions

Choose a pre-styled library to use Stepper with ready-made designs.
For hook-based usage without components, see the Headless API.

Features#

  • Compound component API with eleven sub-components: Root, List, Step, Item, Header, Number, Title, Separator, Panels, Panel, Content
  • Horizontal layout via List + Step + Panels + Panel
  • Vertical layout via Item + Step + Panel + Content
  • Steps-only mode by omitting Panels/Panel

Usage#

import { Stepper } from 'primereact/stepper';
<Stepper.Root>
    <Stepper.List>
        <Stepper.Step>
            <Stepper.Header>
                <Stepper.Number></Stepper.Number>
                <Stepper.Title></Stepper.Title>
            </Stepper.Header>
            <Stepper.Separator />
        </Stepper.Step>
    </Stepper.List>
    <Stepper.Panels>
        <Stepper.Panel></Stepper.Panel>
    </Stepper.Panels>
</Stepper.Root>

Vertical Layout#

Wrap each step header and panel inside Stepper.Item for vertical orientation. Use Stepper.Separator and Stepper.Content inside Stepper.Panel for proper vertical structure.

<Stepper.Root>
    <Stepper.Item>
        <Stepper.Step>
            <Stepper.Header>
                <Stepper.Number></Stepper.Number>
                <Stepper.Title></Stepper.Title>
            </Stepper.Header>
        </Stepper.Step>
        <Stepper.Panel>
            <Stepper.Separator />
            <Stepper.Content></Stepper.Content>
        </Stepper.Panel>
    </Stepper.Item>
</Stepper.Root>

Behavior#

Motion Animation#

Use motionProps on Root to configure panel open/close animations in vertical layout.

<Stepper.Root motionProps={{ name: 'p-collapsible', cssVarPrefix: 'stepper-panel', hideStrategy: 'remove' }}></Stepper.Root>

See Motion for animation phases, CSS variables, and hide strategies.

Polymorphic Rendering#

Use as on any sub-component to change the rendered HTML element.

<Stepper.Root as="nav">
    <Stepper.List as="ol">
        <Stepper.Step as="li"></Stepper.Step>
    </Stepper.List>
</Stepper.Root>

Default elements: Root=div, List=div, Step=div, Item=div, Header=button, Number=span, Title=span, Separator=span, Panels=div, Panel=div, Content=div.

Render Function Children#

Panel accepts a render function as children, providing access to the component instance. The instance exposes stepper (root instance), stepperitem (parent item instance), active, and activeValue.

<Stepper.Panel>{(instance) => <div>Step is {instance.active ? 'active' : 'inactive'}</div>}</Stepper.Panel>

Pass Through#

Some parts may not be visible in the preview depending on the component's current state.

Loading...
/* Select a part to see its CSS selector for custom styling */

API#

StepperRoot#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperRootInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperRootInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperRootInstance—
The instance to pass to the component.
ptSafeRecord<StepperRootPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperRootInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
defaultValuestring | number—
Default value of the active step.
valuestring | number—
Value of the active step.
linearbooleanfalse
Whether the steps are clickable or not.
onValueChange(event: useStepperChangeEvent) => void—
Callback fired when the stepper's value changes.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"stepper"
data-part"root"

Defines passthrough(pt) options of Stepper component.

labeltypedescription
rootStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.
listStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the list's DOM element.
stepStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the step's DOM element.
headerStepperRootPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the header's DOM element.
numberStepperRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the number's DOM element.
titleStepperRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the title's DOM element.
separatorStepperRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the separator's DOM element.
panelsStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the panels's DOM element.
panelStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the panel's DOM element.
itemStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the item's DOM element.
contentStepperRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the content's DOM element.

StepperList#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperListInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperListInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperListInstance—
The instance to pass to the component.
ptSafeRecord<StepperListPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperListInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of StepperList component.

labeltypedescription
rootStepperListPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

StepperItem#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperItemInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperItemInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperItemInstance—
The instance to pass to the component.
ptSafeRecord<StepperItemPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperItemInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
valuestring | number—
Value of the step.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"stepper"
data-part"item"
data-activePresent when item is active

Defines passthrough(pt) options of StepperItem component.

labeltypedescription
rootStepperItemPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

StepperStep#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperStepInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperStepInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperStepInstance—
The instance to pass to the component.
ptSafeRecord<StepperStepPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperStepInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
valuestring | number—
Value of the step.
disabledbooleanfalse
Whether the step is disabled.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"stepper"
data-part"step"
data-activePresent when step is active
data-disabledPresent when step is disabled

Defines passthrough(pt) options of StepperStep component.

labeltypedescription
rootStepperStepPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

StepperHeader#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperHeaderInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperHeaderInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperHeaderInstance—
The instance to pass to the component.
ptSafeRecord<StepperHeaderPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperHeaderInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"stepper"
data-part"header"

Defines passthrough(pt) options of StepperHeader component.

labeltypedescription
rootStepperHeaderPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

StepperNumber#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperNumberInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperNumberInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperNumberInstance—
The instance to pass to the component.
ptSafeRecord<StepperNumberPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperNumberInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of StepperNumber component.

labeltypedescription
rootStepperNumberPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the root's DOM element.

StepperTitle#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperTitleInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperTitleInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperTitleInstance—
The instance to pass to the component.
ptSafeRecord<StepperTitlePassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperTitleInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of StepperTitle component.

labeltypedescription
rootStepperTitlePassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the root's DOM element.

StepperSeparator#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperSeparatorInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperSeparatorInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperSeparatorInstance—
The instance to pass to the component.
ptSafeRecord<StepperSeparatorPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperSeparatorInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of StepperSeparator component.

labeltypedescription
rootStepperSeparatorPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the root's DOM element.

StepperPanels#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperPanelsInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperPanelsInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperPanelsInstance—
The instance to pass to the component.
ptSafeRecord<StepperPanelsPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperPanelsInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of StepperPanels component.

labeltypedescription
rootStepperPanelsPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

StepperPanel#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperPanelInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperPanelInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperPanelInstance—
The instance to pass to the component.
ptSafeRecord<StepperPanelPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperPanelInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
valuestring | number—
Value of the step.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"stepper"
data-part"panel"
data-activePresent when panel is active

Defines passthrough(pt) options of StepperPanel component.

labeltypedescription
rootStepperPanelPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

StepperContent#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: StepperContentInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: StepperContentInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceStepperContentInstance—
The instance to pass to the component.
ptSafeRecord<StepperContentPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: StepperContentInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of StepperContent component.

labeltypedescription
rootStepperContentPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

Accessibility#

Screen Reader#

Stepper container is defined with the tablist role. Each stepper header has a tab role and aria-controls to refer to the corresponding stepper content element. The content element of each stepper has tabpanel role, an id to match the aria-controls of the header and aria-labelledby reference to the header as the accessible name. Use aria-labelledby on the root element to specify an element to describe the Stepper.

Tab Header Keyboard Support#

KeyFunction
tabMoves focus through the header.
enterActivates the focused stepper header.
spaceActivates the focused stepper header.