Ant Design Svelte

Steps

Task stages: statuses, selection, progress, compact options and multi-step form.

When to use

Steps shows the sequence of stages and the current position: filling out an application, setting up or executing the process. It displays status, but does not validate fields or send requests. To switch independent views, use Tabs.

Indexes and process status

current - index of the active stage, default 0. Previous stages are usually finish, current is process, subsequent stages are wait. status sets the state of the current stage, and items.status allows you to override a specific item.

Script Setting Example
Sequence of actions items, current Main stages
Error at the current stage status="error" Error
Selecting an available stage onChange Interactive stages
Indexes from a different value initial Start index
Fulfilling an application with verification application status Bid

onChange reports the selected index. Update the state and pass it back to current; binding is not provided here. initial offsets the initial index range. Inaccessible steps are set to disabled for item or for all Steps.

Field data, allowed transitions, and error handling belong to the application. The Next button should check the current step before changing current. When repeating the request, save the entered values, and when resetting, protect against the late result of an incomplete operation.

Axis, signatures and stage types

orientation sets horizontal/vertical, titlePlacement — position of the caption relative to the icon. title, subTitle and content accept content, including Svelte snippets. type selects default, dot, navigation, inline or panel; variant - filled/outlined.

responsive switches the normal horizontal view when the viewport is narrow, rather than when the card is narrow. Panel remains horizontal. Wide captions may require local scrolling; its wrapper is preserved in the examples.

percent shows the progress of the current process in the usual type. For your icons, first use items.icon; iconRender allows you to customize the general renderer. Don't expect each type to apply all of the regular Steps settings at the same time: dot, inline, and panel have their own layout.

maxCount limits the number of visible points and replaces hidden ranges with inaccessible ellipses. The original indexes are preserved; The ellipsis is not a new stage. External buttons can transfer current to a hidden range.

Design and interaction

Interactivity appears in the presence of onChange or an item handler. Save available step signatures; The error icon should complement the text description of the status. A stage allowed by pressing cannot be considered as already completed or verified.

classNames/styles configure the structure of all Steps; items.classNames/styles - a separate stage. styles contains CSS strings. Steps component design tokens control geometry and colors; nativeElement provides the root ol after mount. The API and supported slots are listed below, with semantic example showing both levels of customization.

ConfigProvider.steps accepts StepsConfig: class, style, classNames and styles. current, items and onChange remain local props. Callback semantic defaults gets the currently allowed props Steps; classes are added together, local semantic styles override defaults, and item styles clarify the design of a separate step. For root the order is: provider styles.root, provider style, local styles.root, local style. Nested steps={} replaces the entire record. General settings show priorities without changing the selected step.

Timeline uses the root class/style of steps, but does not inherit its semantic classNames/styles. To format events, set ConfigProvider.timeline; an empty timeline does not reset the individual steps-record.

Local prefixCls changes the CSS classes of root, states, stages and progress. A non-empty local prefix takes precedence; the empty string and undefined inherit ConfigProvider.prefixCls with the -steps suffix, defaulting to ant-steps. Identifiers, selected step and namespace of --ant-steps-* / --ant-cmp-steps-* variables are preserved; The generic ant-steps-css-var marker is retained. Semantic classNames/styles and component tokens are applied with the same priorities. In iconRender, the info.components.Icon component gets the same prefix.

Local example toggles namespace next to standard Steps, saves current and supports keyboard selection. Example ConfigProvider shows a common prefix, including that of Steps inside the Timeline. For your own CSS rules, use the selected namespace or semantic classNames.

Examples

  1. Data
    Finished
    Fill in the details
  2. Check
    In progress
    Check the result
  3. Ready
    Waiting
    Complete the action

Basic steps

The current stage is counted from zero. The previous stages get finish, the next ones get wait; The condition can be checked with item.

  1. Data
    Finished
    Fill in the details
  2. Check
    Error
    Check the result
  3. Ready
    Waiting
    Complete the action
error

Error status

status changes the current stage. Retrying the example returns process; network requests are not fulfilled.

  1. Data
    Finished
    Fill in the details
  2. Check
    In progress
    Check the result
  3. Ready
    Waiting
    Complete the action

Vertical placement

orientation=vertical specifies the vertical sequence. Local size takes precedence over the overall gallery size.

  1. In progress
    Available stage
  2. Waiting
    Not yet available
  3. Waiting
    Completion
Index 0

Stage selection

onChange passes the index, the application updates current. An inaccessible item is skipped during keyboard navigation.

  1. Finished
    Fill in the details
  2. In progress
    Check the result
  3. Waiting
    Complete the action

Panel stages

type=panel and filled/outlined options. The panels are always horizontal; on a narrow screen scroll inside Steps.

  1. Document
    Finished
  2. Check
    In progress
  3. Completion
    Waiting
  1. Document
    Finished
  2. Check
    In progress
  3. Completion
    Waiting

Own icons and iconRender

items.icon accepts Snippet. iconRender gets the original icon and info; both forms are shown separately.

  1. Data
    Finished
    Accepted
  2. 2
    Check Текущий этап
    In progress
    In progress
  3. Ready
    Waiting
    Awaiting verification

Labels and progress

titlePlacement controls the placement of captions. percent shows the progress of the current process stage; it does not complete the stage automatically.

  1. Finished
    Description 1
  2. Finished
  3. In progress
    Description 4
  4. Waiting
  5. Waiting
    Description 8
Index 3 from 0–7

Limitation of the number of stages

maxCount collapses hidden ranges into inaccessible ellipses. current stores the index of the original list.

  1. Finished
    Fill in the details
  2. In progress
    Check the result
  3. Waiting
    Complete the action

Dots instead of numbers

type=dot leaves compact marks. The stage selection updates current via a public callback.

  1. In progress
    Fill in the details
  2. Waiting
    Check the result
  3. Waiting
    Complete the action

Navigation steps

type=navigation highlights the current step as a navigation point. When selected, the application updates current.

  1. Data
    Finished
    Fill in the details
  2. Check
    In progress
    Check the result
  3. Ready
    Waiting
    Complete the action

Compact Stages

type=inline is suitable for a short status next to the entry. percent and custom icons are not used for this type.

Compact stages in table

Each record has its own current stage. Table allows horizontal scrolling on a narrow screen.

  1. Data
    Finished
  2. Check
    In progress
  3. Ready
    Waiting

Semantic styles of component and item

Global slots style the root and headers; item.styles adds the design of one item. The styles function reacts to state.

  1. Data
    Finished
  2. Check
    In progress
  3. Ready
    Waiting

Component tokens

Local theme changes the size of the normal and current point. The settings of neighboring cards are saved.

  1. Finished
    Fill in the details
  2. In progress
    Check the result
  3. Waiting
    Complete the action
initial: 5; current: 6

Start index

initial shifts the numbering. onChange returns the index based on initial, not the position in the local array.

  1. Finished
    Description of the stage 1
  2. Finished
  3. In progress
    Description of the stage 4
  4. Waiting
  5. Waiting
    Description of the stage 8

Review options

Saved example of switching five types Steps, outline and maxCount.

  1. Finished
    Fill out the form
  2. In progress
    Data can be changed before sending.
  3. Waiting
    Complete the process

Application step by step

  1. In progress
    Fill out the form
  2. Waiting
    Check application
  3. Waiting
    Submit your request

Application data

Participant name.
name@example.com
Stage: 0. Condition: editing.

Application step by step

Saved review example: form check, edit, submit error, redo and reset.

  1. Finished
  2. In progress
  3. Waiting
  1. Data
    Finished
  2. Check
    In progress
  3. Ready
    Waiting
  1. Data
    Finished
  2. Check
    In progress
  3. Ready
    Waiting

General settings Steps

ConfigProvider.steps, callback current props, local and item-specific styles, reset record.

  1. Finished
  2. 2
    In progress
  3. Waiting
  1. Data
    Finished
  2. 2
    Check
    In progress
  3. Ready
    Waiting
Index 1; prefixCls: woodger-steps

Local CSS prefix

Change namespace, progress, stage selection and standard neighbor; empty prefixCls inherits ConfigProvider.

API

Examples are checked against the current ant.design page and the public API of the installed package. Full definitions of Props are in @woodger/antd.

Topics of official examples
ThemeExample or limitation
BasicCurrent stage and automatic statuses.
Error statusError and retry.
VerticalOrientation and small size.
ClickableControlled selection, disabled and keyboard.
Panel StepsHorizontal panels and filled/outlined options.
With iconitems.icon and iconRender.
Title Placement and ProgressCaptions, subTitle and percent.
Max CountCollapse ranges while maintaining the index.
Dot StyleDots via type="dot".
Navigation StepsNavigation type.
Inline StepsCompact status.
Inline Style CombinationSeveral inline sequences in Table.
Custom semantic dom stylingGeneral and individual semantic styles.
Component configGeneral class/style, callback semantic defaults and local priorities.
Local CSS prefixChange the CSS prefix while maintaining the selection, identifiers and standard neighbor.
Basic parameters Steps
PropertyDescriptionTypeDefault
prefixClsFull local CSS prefix for root, stages and progress. The empty string inherits the common prefix; ant-steps is used without configuration. Ids and namespace of tokens are saved.stringConfigProvider + -steps
itemsStage data; empty conditional entries are skipped.readonly (StepsItem | StepsDataItem | false | null | undefined)[][]
currentCurrent source index taking into account initial. Two-way binding is not provided.number0
onChangeThe application itself updates current. Without callback stages are informational if item.onClick is not set.(index: number) => void—
initialStarting index of numbering and current stage.number0
statusCurrent stage status; item.status overrides automatic.'wait' | 'process' | 'finish' | 'error'process
orientationHorizontal or vertical sequence of steps.'horizontal' | 'vertical'horizontal
titlePlacementPosition of headings and content: next to or below icons.'horizontal' | 'vertical'horizontal
typeRepresentation type.'default' | 'dot' | 'inline' | 'navigation' | 'panel'default
variantFilled or outline design.'filled' | 'outlined'filled
sizeSize of stages.'medium' | 'small'From ConfigProvider
responsiveWhen the viewport is already 532px, switches supported types to vertical; panel is always horizontal.booleantrue
percentProgress of the current process stage; inline does not use percent.number—
maxCountLimiting visible stages from three; hidden ranges are replaced with disabled ellipses.number—
iconRenderSnippet gets originalElement and StepsIconInfo. items.icon is preferable.StepsIconRender—
disabledDisables stage selection.booleanFrom ConfigProvider
classNamesRoot classes and semantic slots of each stage.StepsSemanticSlots | (info) => StepsSemanticSlotsConfigProvider.steps
stylesCSS lines semantic slots.StepsSemanticSlots | (info) => StepsSemanticSlotsConfigProvider.steps
nativeElementbind:nativeElement returns the root ol.HTMLOListElement—

Stage parameters

items supports key, title, subTitle, content, icon, status, disabled, onClick, class/style and custom semantic slots. A regular StepsDataItem allows number, boolean, null, and Snippet in its content; title/icon of the original StepsItem retain compatible types.

ConfigProvider.steps accepts StepsConfig: class, style, classNames and styles. Semantic defaults support an object or callback with the current props. Local styles take precedence; nested steps={} replaces the entire record. Item styles specify a separate stage; current/items/onChange remain local props.

Semantic DOM

Root - ol with role:list, stages - li. Selectable steps use native buttons, the current one is marked with aria-current:step. Non-interactive statuses have localized captions; Selecting and moving focus does not replace application validation.

Steps level classes and styles support root, item, itemWrapper, itemIcon, itemSection, itemHeader, itemTitle, itemSubtitle, itemContent, itemRail. items correspond to them root, wrapper, icon, section, header, title, subtitle, content, rail.

Tab moves focus between available stage buttons, Enter and Space select a stage. There is no separate navigation with arrows, Home and End. ConfigProvider.steps sets class/style and semantic defaults; The status locale is inherited through locale.steps. Local prefixCls changes CSS classes, preserving ids, keyboard and Steps CSS variables.

Registration tokens

The current ant.design page lists the following 11 component tokens. The package accepts them via ConfigProvider theme.components.Steps; the card shows the sizes of the dots.

Component tokens
TokenPurpose
customIconFontSizeCustom icon font size.
customIconSizeCustom icon container size.
customIconTopVertical offset of the custom icon.
dotCurrentSizeSize of the current point.
dotSizeRegular dot size.
iconFontSizeIcon font size.
iconSizeRegular icon size.
iconSizeSMSmall icon size.
iconTopVertical offset of the icon.
navArrowColorNavigation arrow color.
navContentMaxWidthMaximum width of navigation content.
Common tokens of the current topic
TokenCurrent value
colorBgContainer#ffffff
colorError#ff4d4f
colorErrorBg#fff2f0
colorErrorBgFilledHover#ffdfdc
colorErrorHover#ff7875
colorFillTertiaryrgba(0,0,0,0.04)
colorPrimary#2f54eb
colorPrimaryBg#f0f5ff
colorPrimaryBgHover#d6e4ff
colorPrimaryBorder#adc6ff
colorPrimaryHover#597ef7
colorSplitrgba(5,5,5,0.06)
colorTextrgba(0,0,0,0.88)
colorTextDescriptionrgba(0,0,0,0.45)
colorTextDisabledrgba(0,0,0,0.25)
colorTextLabelrgba(0,0,0,0.65)
colorTextLightSolid#fff
colorTextQuaternaryrgba(0,0,0,0.25)
colorTextSecondaryrgba(0,0,0,0.65)
borderRadius6
borderRadiusSM4
controlHeight32
controlItemBgHoverrgba(0,0,0,0.04)
fontFamily-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSize14
fontSizeIcon12
fontSizeLG16
fontSizeSM12
lineHeight1.5714285714285714
lineHeightLG1.5
lineHeightSM1.6666666666666667
lineTypesolid
lineWidth1
lineWidthBold2
lineWidthFocus3
margin16
marginSM12
marginXS8
marginXXS4
motionDurationMid0.2s
motionDurationSlow0.3s
paddingSM12
paddingXS8
paddingXXS4

FAQ

Why did current not change after pressing?

onChange communicates the intent. Update the value in the application and pass it back.

How to set direction, text and points?

Use orientation, titlePlacement, items.content and type:dot.

What indexes come with maxCount?

Indexes of the original list. The ellipses indicate a range and are not selectable.

Why does the horizontal type scroll?

responsive takes viewport into account. For normal stages, you can choose vertical; panel remains horizontal.

Does Steps store the fields and result of the application?

No. This data, validation, retry and cancellation of the operation are managed by the application.