JGuang

Steps

Steps · Ant Design

Preview
npm install antd@6.6.5 @ant-design/icons@6.3.4 dayjs@1.11.23

Steps

A navigation bar that guides users through the steps of a task.

When To Use

When a given task is complicated or has a certain sequence in the series of subtasks, we can decompose it into several steps to make things easier.

Examples

  • Basic · simple

  • Error status · error

  • Vertical · vertical

  • Clickable · clickable

  • Panel Steps · panel

  • With icon · icon

  • Title Placement and Progress · title-placement

  • Max Count · max-count

  • Dot Style · progress-dot

  • Navigation Steps · nav

  • Inline Steps · inline

  • Inline Style Combination · inline-variant

  • Custom semantic dom styling · style-class

API

Common props ref:Common props

Steps

The whole of the step bar.

PropertyDescriptionTypeDefaultVersionGlobal Config
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-6.0.0
currentTo set the current step, counting from 0. You can overwrite this state by using status of Stepnumber0×
directionTo specify the direction of the step bar, horizontal or verticalstringhorizontal×
iconRenderCustom render icon, please use items.icon first(oriNode, info: { index, active, item }) => ReactNode-×
initialSet the initial step, counting from 0number0×
labelPlacementPlace title and content with horizontal or vertical directionstringhorizontal×
maxCountMaximum number of step items to display (>= 3). Hidden ranges are collapsed into disabled ellipsis steps.number-×
orientationTo specify the orientation of the step bar, horizontal or verticalstringhorizontal×
percentProgress circle percentage of current step in process status (only works on basic Steps)number-4.5.0×
progressDotSteps with progress dot style, customize the progress dot by setting it to a function. Please use type="dot" instead. titlePlacement will be verticalboolean | (iconDot, { index, status, title, content }) => ReactNodefalse×
responsiveChange to vertical direction when screen width smaller than 532pxbooleantrue×
sizeTo specify the size of the step bar, medium and small are currently supportedstringmedium×
statusTo specify the status of current step, can be set to one of the following values: wait process finish errorstringprocess×
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-6.0.0
titlePlacementPlace title and content with horizontal or vertical directionstringhorizontal×
typeType of steps, can be set to one of the following values: default dot inline navigation panelstringdefault×
variantConfig style variantfilled | outlinedfilled×
onChangeTrigger when Step is changed(current) => void-×
itemsStepItem contentStepItem[]4.24.0×

StepItem

A single step in the step bar.

PropertyDescriptionTypeDefaultVersion
contentDescription of the step, optional propertyReactNode-
descriptionDescription of the step, optional propertyReactNode-
disabledDisable clickbooleanfalse
iconIcon of the step, optional propertyReactNode-
statusTo specify the status. It will be automatically set by current of Steps if not configured. Optional values are: wait process finish errorstringwait
subTitleSubtitle of the stepReactNode-
titleTitle of the stepReactNode-

Semantic DOM

Steps

Semantic nodeNative descriptionVersion
rootRoot element with flex layout, nowrap, alignment, CSS variables and other basic step container styles—
itemStep item element with flex layout, relative positioning and other basic step item container styles—
itemWrapperStep item wrapper element with flex layout, nowrap, top padding and other step content wrapping styles—
itemIconStep item icon element with icon size, positioning, font-size and other icon display related styles—
itemHeaderStep item header element with flex layout, nowrap, alignment and other header area layout styles—
itemTitleStep item title element with color, font-size, line-height, word-break, transitions and other title text styles—
itemSubtitleStep item subtitle element with color, font-weight, font-size, line-height, margin, word-break and other subtitle styles—
itemSectionStep item section element with step content area layout and styling—
itemContentStep item content element with color, font-size, line-height, word-break, transitions and other content text styles—
itemRailStep item rail element with border-style, border-width, transitions and other connecting line styles—

Semantic description source: vendor/components/steps/demo/_semantic.tsx

StepItem

Semantic nodeNative descriptionVersion
rootRoot element—
wrapperStep item wrapper element—
iconStep item icon element—
headerStep item header element—
titleStep item title element—
subtitleStep item subtitle element—
sectionStep item section element—
contentStep item content element—
railStep item rail element—

Semantic description source: vendor/components/steps/demo/_semantic_items.tsx

Design Token

Types, inheritance and declarations retain the pinned native source. Defaults are computed by the native theme and may be overridden by ConfigProvider; this table does not invent static defaults.

TokenTypeNative description
descriptionMaxWidth?numberMax width of description area
customIconSizenumberSize of custom icon container
customIconTopnumberTop of custom icon
customIconFontSizenumberFont size of custom icon
iconSizenumberSize of icon container
iconTopnumberTop of icon
iconFontSizenumberSize of icon
dotSizenumberSize of dot
dotCurrentSizenumberCurrent size of dot
navArrowColorstringColor of arrow in nav
navContentMaxWidthCSSProperties['maxWidth']Max width of nav content
iconSizeSMnumber | stringSize of small steps icon
titleLineHeightnumber | stringLine height of title

Declaration source: vendor/components/steps/style/index.ts

import type { CSSProperties } from 'react';

import type { CSSObject } from '@ant-design/cssinjs';

import { genFocusOutline, resetComponent, textEllipsis } from '../../style';

import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';

import { genStyleHooks, mergeToken } from '../../theme/internal';

import { genCssVar } from '../../theme/util/genStyleUtils';

import genHorizontalStyle from './horizontal';

import genIconStyle from './icon';

import genInlineStyle from './inline';

import genLabelPlacementStyle from './label-placement';

import genMaxCountStyle from './max-count';

import genLegacyNavStyle from './nav';

import genPanelStyle from './panel';

import genStepsProgressStyle from './progress';

import genDotStyle from './progress-dot';

import genRTLStyle from './rtl';

import genSmallStyle from './small';

import genStatusStyle from './status';

import genVerticalStyle from './vertical';

export interface ComponentToken {
  /**
   * @desc 描述区域最大宽度
   * @descEN Max width of description area
   * @deprecated This value has been removed by default since v6
   */
  descriptionMaxWidth?: number;
  /**
   * @desc 自定义图标容器尺寸
   * @descEN Size of custom icon container
   */
  customIconSize: number;
  /**
   * @desc 自定义图标 top
   * @descEN Top of custom icon
   */
  customIconTop: number;
  /**
   * @desc 自定义图标大小
   * @descEN Font size of custom icon
   */
  customIconFontSize: number;
  /**
   * @desc 图标容器尺寸
   * @descEN Size of icon container
   */
  iconSize: number;
  /**
   * @desc 图标 top
   * @descEN Top of icon
   */
  iconTop: number;
  /**
   * @desc 图标大小
   * @descEN Size of icon
   */
  iconFontSize: number;
  /**
   * @desc 点状步骤点大小
   * @descEN Size of dot
   */
  dotSize: number;
  /**
   * @desc 点状步骤点当前大小
   * @descEN Current size of dot
   */
  dotCurrentSize: number;
  /**
   * @desc 可跳转步骤条箭头颜色
   * @descEN Color of arrow in nav
   */
  navArrowColor: string;
  /**
   * @desc 可跳转步骤条内容最大宽度
   * @descEN Max width of nav content
   */
  navContentMaxWidth: CSSProperties['maxWidth'];
  /**
   * @desc 小号步骤条图标大小
   * @descEN Size of small steps icon
   */
  iconSizeSM: number | string;
  /**
   * TODO: deprecated warning since not used anymore
   * @desc 标题行高
   * @descEN Line height of title
   * @deprecated Not used anymore
   */
  titleLineHeight: number | string;
}

export interface StepsToken extends FullToken<'Steps'> {
  inlineDotSize: number;
}

Shared native props

Tips: The following generic properties apply to most antd components; those not supported are described separately.

PropertyDescriptionTypeDefault
styleThe additional styleCSSProperties-
classNameThe additional css classstring-
rootClassNameClassName on the root elementstring-
autoFocusAuto focus when component mounted, only effective for focusable elements like forms, links, etc.booleanfalse

Install and reproduce an example

npm install antd@6.6.5 @ant-design/icons@6.3.4 dayjs@1.11.23

Use ConfigProvider and native App; configure dayjs locale separately. Each example lists its complete source files and additional pinned dependencies in View code. Example names select demos, not universal component props. See the resource setup guide for theme, locale and SSR.

Native type references

The source viewer includes unchanged native implementations and the following source declarations. Inherited types remain in their native packages. English source comments are preserved as code reference.

  • vendor/components/steps/PanelArrow.tsx
  • vendor/components/steps/ProgressIcon.tsx
  • vendor/components/steps/context.ts
  • vendor/components/steps/index.tsx
  • vendor/components/steps/style/index.ts
  • vendor/components/steps/useDisplaySteps.ts

Source and license

https://github.com/ant-design/ant-design/tree/4a39f54842eade4e565ab336ef6097cd7e723cdd

Original bilingual prose and executable examples are retained. Website-only embeds and token tables are expanded locally. Ant Design is MIT; separately listed dependency notices also apply. Upload previews block outbound requests and do not provide a backend.