Skip to main content

Stepper

TkStepper component for managing a series of steps.

import { TkStepper, TkStep } from '@takeoff-ui/react'

Step Mode​

Stepper component supports different step modes: basic and number. Control this with the stepMode property.

View Code

Linear Mode​

Enable linear progression mode to ensure users can only navigate to the next step or previous steps, but cannot skip ahead. Control this with the linear property.

In linear mode, steps must be completed in sequence

View Code

Controlled Stepper​

The stepper component can be controlled externally using the controlled component pattern. Set the active step with the active prop and listen for step changes with the tkStepChange event.

This example demonstrates a controlled stepper component used with a multi-step form. The active step is controlled by the parent component's state.

Personal Information

View Code

Custom Icons​

Icons throughout the stepper can be customized. Each step can have its own icon, or you can set global icon styles using properties like completeIcon, errorIcon, etc.

Icon Configuration

The stepper component accepts both simple string icons and complex icon configuration objects. For advanced customization, you can use:

icon={{
  name: "apps",
  style: "rounded",
  fill: true,
  color: "#00796B"
}}
View Code

Style Customization​

The stepper component offers three style props for visual customization: containerStyle, contentStyle, and signStyle. Each targets a specific part of the component.

Container Style

Use containerStyle to customize the main container of the stepper component.

Content Style

Use contentStyle to customize the content area (header and subheader) of each step.

Sign Style & Custom Icons

Use signStyle on the Stepper component for global styling of step indicators, and icon props on both levels for customization.

View Code
// Container Style Example
<TkStepper
containerStyle={{
backgroundColor: "var(--neutral-50)",
padding: "20px",
borderRadius: "12px",
border: "1px solid var(--neutral-200)",
boxShadow: "0 4px 6px var(--alpha-neutral-neutral-500-8)"
}}
>
<TkStep header="Step 1" subheader="Container styling" complete />
<TkStep header="Step 2" subheader="Custom background" isActive />
<TkStep header="Step 3" subheader="With borders" />
</TkStepper>

// Content Style Example
<TkStepper
contentStyle={{
backgroundColor: "var(--neutral-0)",
padding: "8px 10px",
borderRadius: "8px",
borderLeft: "2px solid var(--primary-base)",
boxShadow: "0 2px 4px var(--alpha-neutral-neutral-500-4)",
display: "flex",
flexDirection: "column",
justifyContent: "center"
}}
>
<TkStep header="Step 1" subheader="Content styling" complete />
<TkStep header="Step 2" subheader="Custom content borders" isActive />
<TkStep header="Step 3" subheader="With shadows" />
</TkStepper>

// Sign Style & Custom Icons Example
<TkStepper
signStyle={{
backgroundColor: "var(--primary-50)",
border: "2px solid var(--primary-300)",
borderRadius: "8px"
}}
// Global icons applied to all steps unless overridden
completeIcon={{
name: "check_circle",
style: 'rounded',
fill: true,
color: "var(--primary-base)"
}}
activeIcon={{
name: "radio_button_checked",
style: 'rounded',
fill: true,
color: "var(--primary-base)"
}}
inactiveIcon={{
name: "radio_button_unchecked",
style: 'rounded',
fill: false,
color: "var(--red-200)"
}}
>
<TkStep header="Step 1" subheader="Global sign style" complete />
<TkStep header="Step 2" subheader="Global icons" isActive />
<TkStep
header="Step 3"
subheader="Step-specific icon"
error
errorIcon={{
name: "warning",
style: 'rounded',
fill: true,
color: "var(--red-500)"
}}
/>
</TkStepper>

Orientation​

Stepper component provides both horizontal and vertical orientations via the orientation property.

View Code

Step API​

Props​

NameTypeDefaultDescription
IIconOptions, stringnullSpecifies a material icon or icon options for active steps.
booleanfalseIndicates if the step has been completed.
IIconOptions, stringnullSpecifies a material icon or icon options for completed steps.
booleanfalseIndicates if the step is disabled (cannot be selected or interacted with).
booleanfalseIndicates if the step has encountered an error.
IIconOptions, stringnullSpecifies a material icon or icon options for error steps.
stringnullThe header text to be displayed for the step.
IIconOptions, stringnullIcon to be displayed for the step. Can be either a string (icon name) or an IIconOptions object.
IIconOptions, stringnullSpecifies a material icon or icon options for inactive steps.
numbernullThe index of the step in the stepper.
booleanfalseIndicates if the step is currently active.
booleantrueWhether the step is clickable.
"flip", "non-flip"'non-flip'Controls the label position of the step.
"basic", "number"'basic'Controls the step mode of the stepper component.
stringnullOptional subheader text to provide additional context for the step.

Interfaces​

interface IStepClickDetail {
index: number;
status: 'completed' | 'active' | 'inactive' | 'error' | 'disabled';
}

Stepper API​

Props​

NameTypeDefaultDescription
number0Currently active step index
IIconOptions, stringnullSpecifies a material icon or icon options for active steps.
IIconOptions, stringnullSpecifies a material icon or icon options for completed steps.
anynullThe style attribute of container element
anynullThe style attribute of content elements
booleanfalseControls if the tabs component is controlled.
IIconOptions, stringnullSpecifies a material icon or icon options for error steps.
IIconOptions, stringnullSpecifies a material icon or icon options for inactive steps.
booleanfalseWhether the steps follow a linear progression (can only navigate to the next step when current step is completed).
"horizontal", "vertical"'horizontal'Controls the orientation of the stepper component.
booleantrueWhether to show completed steps with the complete state. If false, completed steps will appear as just passed and not with complete styling.
anynullThe style attribute of step sign elements
"basic", "number"'basic'Controls the step mode of the stepper component.

Events​

NameDescription
tk-step-changeEmitted when the active step changes.
tk-step-clickEmitted when a step is clicked.

Methods​

NameDescription
setActiveSets the active step index.

Interfaces​

interface IStepClickDetail {
index: number;
status: 'completed' | 'active' | 'inactive' | 'error' | 'disabled';
}