Stepper

23 Sep 20258 minutes to read

The Stepper component visualizes several steps and indicates the current progress by highlighting already completed steps.

<nav id="stepper"></nav>
<script>
  let stepperObj: Stepper = new Stepper({steps : [{}, {}, {}, {}, {}]});
  stepperObj.appendTo('#stepper');
</script>

Properties

activeStep number

Defines the current step index of the Stepper.

    <nav id="stepper"> </nav>
import { Stepper } from '@syncfusion/ej2-navigations';
let stepperObj: Stepper = new Stepper({
    steps : [{}, {}, {}, {}, {}],
    activeStep: 2
});
stepperObj.appendTo('#stepper');

Defaults to 0

animation StepperAnimationSettingsModel

Defines the step progress animation of the Stepper.

    <nav id="stepper"> </nav>
import { Stepper } from '@syncfusion/ej2-navigations';
let stepperObj: Stepper = new Stepper({
    steps : [{}, {}, {}, {}, {}],
    animation: {enable: true, duration: 2000, delay: 1000}
});
stepperObj.appendTo('#stepper');

cssClass string

Defines the CSS class to customize the Stepper appearance.

Defaults to ’’

enablePersistence boolean

Enable or disable persisting component’s state between page reloads.

Defaults to false

enableRtl boolean

Enable or disable rendering component in right to left direction.

Defaults to false

labelPosition string|StepLabelPosition

Defines the label position in the Stepper.
The possible values are:

  • Top
  • Bottom
  • Start
  • End
    <nav id="stepper"> </nav>
import { Stepper, StepModel } from '@syncfusion/ej2-navigations';

const iconWithLabel: StepModel[] = [
    { label: 'Cart', icon: 'sf-icon-shopping-cart' },
    { label: 'Personal Info', icon: 'sf-icon-user-info' },
    { label: 'Delivery Address', icon: 'sf-icon-transport' },
    { label: 'Payment', icon: 'sf-icon-cash' },
    { label: 'Confirmation', icon: 'sf-icon-ordered' }
];

let stepperObj: Stepper = new Stepper({
    steps : iconWithLabel,
    labelPosition: 'bottom'
});
stepperObj.appendTo('#stepper');

Defaults to StepLabelPosition.Bottom

linear boolean

Defines whether allows to complete one step in order to move to the next or not.

    <nav id="stepper"> </nav>
import { Stepper } from '@syncfusion/ej2-navigations';
let stepperObj: Stepper = new Stepper({
    steps : [{}, {}, {}, {}, {}],
    linear: true
});
stepperObj.appendTo('#stepper');

Defaults to false

locale string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

Defaults to ’’

orientation string|StepperOrientation

Defines the orientation type of the Stepper.
The possible values are:

  • Horizontal
  • vertical

Defaults to StepperOrientation.Horizontal

readOnly boolean

Defines whether the read-only mode is enabled for a Stepper control, which means that the user will not be able to interact with it.

Defaults to false

showTooltip boolean

Defines a value that defines whether to show tooltip or not on each step.

Defaults to false

stepType string|StepType

Defines whether steps are display with only indicator, only labels or combination of both.
The possible values are:

  • Default
  • Label
  • Indicator
    <nav id="stepper"> </nav>
import { Stepper, StepModel } from '@syncfusion/ej2-navigations';

const iconWithLabel: StepModel[] = [
    { label: 'Cart', icon: 'sf-icon-shopping-cart' },
    { label: 'Personal Info', icon: 'sf-icon-user-info' },
    { label: 'Delivery Address', icon: 'sf-icon-transport' },
    { label: 'Payment', icon: 'sf-icon-cash' },
    { label: 'Confirmation', icon: 'sf-icon-ordered' }
];

let stepperObj: Stepper = new Stepper({
    steps : iconWithLabel,
    stepType: 'indicator'
});
stepperObj.appendTo('#stepper');

Defaults to StepType.Default

steps StepModel[]

Defines the list of steps.

Defaults to []

template string|Function

Defines the template content for each step.

    <nav id="stepper"></nav>
import { Stepper } from '@syncfusion/ej2-navigations';
let stepperObj: Stepper = new Stepper({
    steps : [{}, {}, {}, {}, {}],
    template: '<span>${currentStep}</span>'
});
stepperObj.appendTo('#stepper');

Defaults to ’’

tooltipTemplate string|Function

Defines the template content for the tooltip.

Defaults to ’’

Methods

addEventListener

Adds the handler to the given event listener.

Parameter Type Description
eventName string A String that specifies the name of the event
handler Function Specifies the call to run when the event occurs.

Returns void

appendTo

Appends the control within the given HTML element

Parameter Type Description
selector (optional) string | HTMLElement Target element where control needs to be appended

Returns void

attachUnloadEvent

Adding unload event to persist data when enable persistence true

Returns void

dataBind

When invoked, applies the pending property changes immediately to the component.

Returns void

destroy

Destroy the stepper control.

Returns void

detachUnloadEvent

Removing unload event to persist data when enable persistence true

Returns void

getLocalData

Returns the persistence data for component

Returns any

getRootElement

Returns the route element of the component

Returns HTMLElement

handleUnload

Handling unload event to persist data when enable persistence true

Returns void

nextStep

Move to next step from current step in Stepper.

Returns void

previousStep

Move to previous step from current step in Stepper.

Returns void

refresh

Applies all the pending property changes and render the component again.

Returns void

refreshProgressbar

Refreshes the position of the progress bar programmatically when the dimensions of the parent container are changed.

Returns void

removeEventListener

Removes the handler from the given event listener.

Parameter Type Description
eventName string A String that specifies the name of the event to remove
handler Function Specifies the function to remove

Returns void

reset

Reset the state of the Stepper and move to the first step.

Returns void

Inject

Dynamically injects the required modules to the component.

Parameter Type Description
moduleList Function[] ?

Returns void

Events

beforeStepRender EmitType<StepperRenderingEventArgs>

Event triggers before rendering each step.

created EmitType<Event>

Event callback that is raised after rendering the stepper.

stepChanged EmitType<StepperChangedEventArgs>

Event triggers after active step changed.

stepChanging EmitType<StepperChangingEventArgs>

Event triggers before active step change.

stepClick EmitType<StepperClickEventArgs>

Event triggers when clicked on step.