Syncfusion React Stepper

syncfusion/react-ui-components-skills/skills/syncfusion-react-stepper

作者 syncfusion6fb1c883a8412b611b95f839e0cb06e1fc8170a8無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Implement and configure the Syncfusion React Stepper component for guided workflows. Use this skill when creating step-by-step navigation flows, multi-step forms, wizards, or process guides in React. This skill covers step configuration, orientation (horizontal/vertical), events, validation, animations, templates, accessibility, and globalization support for linear or non-linear workflows.

AI 產生的概覽

指導實作 Syncfusion React Stepper 元件,用於多步驟工作流程與精靈。

功能
此技能提供參考文件,用於在 React 應用程式中實作與設定 Syncfusion React Stepper 元件。內容涵蓋步驟設定、水平與垂直方向、步驟類型、事件、線性流程與驗證、動畫、範本、工具提示、無障礙與全球化。它產出用於建構分步導覽流程、多步驟表單與精靈的指引與程式碼範例。
適用情境
適用於在 React 中建構引導式多步驟體驗的情境,例如結帳流程、註冊精靈、設定流程或問卷調查。也適用於需要為步驟元件設定驗證、線性或非線性導覽或本地化時。
執行需求
需要一個 React 專案,並安裝 Syncfusion React 導覽套件及其基礎與導覽主題樣式表。此技能不附帶指令碼,僅為說明與參考文件。

Implementing Syncfusion React Stepper

The Stepper component guides users through a multi-step workflow or process with visual indicators, step labels, and flexible configuration. It's ideal for wizards, checkout flows, onboarding processes, and any guided user experience requiring sequential navigation.

When to Use This Skill

Use the Stepper component when you need to:

  • Guide users through multi-step processes (checkout, registration, setup wizards)
  • Display step-by-step workflows with progress indication
  • Validate user input before advancing to the next step
  • Support linear or non-linear navigation patterns
  • Customize appearance with icons, labels, and templates
  • Localize content for different languages/regions

Component Overview

Key Capabilities:

  • Step Navigation: Horizontal and vertical orientations, sequential or free navigation
  • Step Types: Default (icons + labels), label-only, or indicator-only modes
  • Events: Track step changes, validations, and interactions
  • Styling: Animations, templates, custom CSS, and tooltips
  • Accessibility: Full keyboard navigation and ARIA support
  • Globalization: Multi-language support and RTL compatibility

Documentation and Navigation Guide

Getting Started & Installation

📄 Read: references/getting-started.md [blocked]

  • Package installation and dependencies
  • CSS imports and theme setup
  • Creating your first stepper
  • Initial configuration and rendering

Core Configuration: Steps and Properties

📄 Read: references/steps-and-configuration.md [blocked]

  • Adding and defining steps with StepDirective
  • Icon CSS, text, and label properties
  • Active step management
  • Disabled states and customization
  • CSS class configuration

Layout & Appearance: Orientations and Types

📄 Read: references/orientations-and-types.md [blocked]

  • Horizontal and vertical orientations
  • Step type modes (Default, Label, Indicator)
  • Label positioning (Top, Bottom, Start, End)
  • RTL support and responsive design

Interaction & Behavior: Events

📄 Read: references/events-and-interactions.md [blocked]

  • Lifecycle events: created, stepChanged, stepChanging
  • User interaction events: stepClick, beforeStepRender
  • Event arguments and handling patterns
  • Preventing unwanted transitions

Workflow Control: Linear Flow and Validation

📄 Read: references/linear-flow-and-validation.md [blocked]

  • Linear stepper configuration for sequential navigation
  • Step validation and status management
  • Preventing invalid transitions
  • Resetting stepper state

Advanced Styling & Customization

📄 Read: references/animation-template-tooltip.md [blocked]

  • Animation configuration and timing
  • Template customization for steps
  • Tooltip integration and display
  • Custom content rendering

Methods and Advanced Patterns

📄 Read: references/methods-and-advanced.md [blocked]

  • Component methods (reset, etc.)
  • Both API patterns (component-based vs property-based)
  • Advanced use cases and patterns
  • Performance optimization tips

Best Practices: Accessibility & Localization

📄 Read: references/accessibility-globalization.md [blocked]

  • WCAG compliance and ARIA attributes
  • Keyboard navigation guidelines
  • Globalization and localization
  • RTL support implementation

Quick Start Examples

Pattern 1: Component-Based (StepsDirective)

jsx
import React from 'react';import { StepperComponent, StepsDirective, StepDirective } from '@syncfusion/ej2-react-navigations';import '@syncfusion/ej2-base/styles/tailwind3.css';import '@syncfusion/ej2-navigations/styles/tailwind3.css';
function App() {  return (    <div>      <StepperComponent>        <StepsDirective>          <StepDirective iconCss="sf-icon-cart" label="Cart" />          <StepDirective iconCss="sf-icon-transport" label="Delivery" />          <StepDirective iconCss="sf-icon-payment" label="Payment" />          <StepDirective iconCss="sf-icon-success" label="Confirmation" />        </StepsDirective>      </StepperComponent>    </div>  );}
export default App;

Pattern 2: Property-Based (steps Array)

jsx
import React from 'react';import { StepperComponent } from '@syncfusion/ej2-react-navigations';import '@syncfusion/ej2-base/styles/tailwind3.css';import '@syncfusion/ej2-navigations/styles/tailwind3.css';
function App() {  const steps = [    { iconCss: 'sf-icon-cart', label: 'Cart' },    { iconCss: 'sf-icon-transport', label: 'Delivery' },    { iconCss: 'sf-icon-payment', label: 'Payment' },    { iconCss: 'sf-icon-success', label: 'Confirmation' }  ];
  return (    <div>      <StepperComponent steps={steps} />    </div>  );}
export default App;

Common Patterns

Pattern 1: Wizard with Validation

jsx
const [activeStep, setActiveStep] = React.useState(0);const stepperRef = React.useRef(null);
const handleStepChanging = (args) => {  // Validate current step before advancing  if (!validateStep(activeStep)) {    args.cancel = true; // Prevent transition  }};
<StepperComponent   ref={stepperRef}  stepChanging={handleStepChanging}>  {/* steps */}</StepperComponent>

Pattern 2: Linear vs Non-Linear Navigation

jsx
// Linear: Users must complete steps sequentially<StepperComponent linear={true}>
// Non-linear: Users can skip to any step<StepperComponent linear={false}>

Pattern 3: Responsive Orientation

jsx
// Auto-switch orientation based on screen sizeconst [orientation, setOrientation] = React.useState('horizontal');
React.useEffect(() => {  const handleResize = () => {    setOrientation(window.innerWidth < 768 ? 'vertical' : 'horizontal');  };  window.addEventListener('resize', handleResize);  return () => window.removeEventListener('resize', handleResize);}, []);
<StepperComponent orientation={orientation}>

Key Props and Configuration

Component Properties

PropTypeDefaultPurpose
activeStepnumber0Currently active step index
animationStepperAnimationSettingsModelundefinedAnimation configuration (enable, duration, delay)
cssClassstring''CSS class for custom styling
enablePersistencebooleanfalsePersist component state between page reloads
enableRtlbooleanfalseEnable right-to-left layout
labelPositionstring'Bottom'Label placement: 'Top', 'Bottom', 'Start', 'End'
linearbooleanfalseEnforce sequential step navigation
localestring'en-US'Localization culture code
orientationstring'horizontal'Layout direction: 'horizontal' or 'vertical'
readOnlybooleanfalseDisable user interaction
showTooltipbooleantrueShow tooltips on hover
stepTypestring'Default'Visual mode: 'Default', 'Label', 'Indicator'
stepsStepModel[][]Array of step objects (property-based pattern)
templatestring | functionundefinedCustom template for steps
tooltipTemplatestring | functionundefinedCustom template for tooltips

Step Properties (StepModel)

PropertyTypePurpose
cssClassstringCSS class for individual step styling
disabledbooleanDisable the step
iconCssstringIcon CSS class for the step
isValidbooleanValidation status of the step
labelstringStep label text
optionalbooleanMark step as optional
statusstringStep status: 'NotStarted', 'InProgress', 'Completed'
textstringText content (usually number)

Animation Settings

PropertyTypeDefaultPurpose
enablebooleantrueEnable animations
durationnumber400Animation duration in milliseconds
delaynumber0Delay before animation starts

Events

EventFiresUse ForArguments
createdAfter component initializationSetup, initializationEvent
stepChangedAfter step changesUpdate UI, load contentStepperChangedEventArgs
stepChangingBefore step changesValidate, prevent transitionsStepperChangingEventArgs
stepClickUser clicks stepTrack interactionsStepperClickEventArgs
beforeStepRenderBefore rendering each stepCustomize step appearanceStepperRenderingEventArgs

Methods

MethodParametersReturnsPurpose
reset()nonevoidReset stepper to initial state (activeStep: 0)
nextStep()nonevoidMove to next step programmatically
previousStep()nonevoidMove to previous step programmatically
refreshProgressbar()nonevoidRefresh progress bar on container resize
destroy()nonevoidDestroy component and release resources

Event Arguments Reference:

  • StepperChangedEventArgs: activeStep, previousStep, isInteracted, name, event, element
  • StepperChangingEventArgs: activeStep, previousStep, cancel, isInteracted, name, event, element
  • StepperClickEventArgs: activeStep, name, event, element
  • StepperRenderingEventArgs: activeStep, name, element

Common Use Cases

  • E-Commerce Checkout: Multi-step checkout flow with order review, shipping, payment
  • User Registration: Multi-step signup with email, profile, verification
  • Setup Wizards: Software onboarding with configuration steps
  • Survey Forms: Step-by-step questionnaire with progress indication
  • Installation Guides: Installation steps with instructions and validation

來源與署名

來源:syncfusion/react-ui-components-skills位於skills/syncfusion-react-stepper提交6fb1c88

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架