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
- DataFinishedFill in the details
- CheckIn progressCheck the result
- ReadyWaitingComplete 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.
<script lang="ts">
import { Steps } from '@woodger/antd';
</script>
<Steps aria-label={("Basic steps")}
current={1}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
- DataFinishedFill in the details
- CheckErrorCheck the result
- ReadyWaitingComplete the action
Error status
status changes the current stage. Retrying the example returns process; network requests are not fulfilled.
<script lang="ts">
import { Steps, Button } from '@woodger/antd';
let status = $state<'error' | 'process'>('error');
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
output {
display: block;
margin-top: 16px;
}
</style>
<div
class="controls"
><Button
onclick={() => { status = status === 'error' ? 'process' : 'error'; }}
>
{(status === 'error' ? "Repeat check" : "Show error")}
</Button></div>
<Steps aria-label={("Stages with error")}
current={1} {status}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
<output aria-label={("Stage status")}>{status}</output>
- DataFinishedFill in the details
- CheckIn progressCheck the result
- ReadyWaitingComplete the action
Vertical placement
orientation=vertical specifies the vertical sequence. Local size takes precedence over the overall gallery size.
<script lang="ts">
import { Steps, Checkbox } from '@woodger/antd';
let small = $state(false);
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
</style>
<div
class="controls"
><Checkbox
bind:checked={small}
>{("Small vertical stages")}</Checkbox></div>
<Steps aria-label={("Vertical stages")}
current={1} orientation="vertical" size={small ? 'small' : 'medium'}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
- In progressAvailable stage
- WaitingNot yet available
- WaitingCompletion
Stage selection
onChange passes the index, the application updates current. An inaccessible item is skipped during keyboard navigation.
<script lang="ts">
import { Steps } from '@woodger/antd';
let current = $state(0);
</script>
<style>
output {
display: block;
margin-top: 16px;
}
</style>
<Steps aria-label={("Stage selection")}
{current} onChange={value => { current = value; }}
items={([
{ key: 'data', title: "Data", content: "Available stage" },
{ key: 'access', title: "Access", content: "Not yet available", disabled: true },
{ key: 'done', title: "Ready", content: "Completion" }
])}
/>
<output aria-label={("Selected stage")}>{("Index ")}{current}</output>
- FinishedFill in the details
- In progressCheck the result
- WaitingComplete the action
Panel stages
type=panel and filled/outlined options. The panels are always horizontal; on a narrow screen scroll inside Steps.
<script lang="ts">
import { Steps, Checkbox } from '@woodger/antd';
let current = $state(1);
let outlined = $state(false);
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
</style>
<div class="controls">
<Checkbox bind:checked={outlined}>{("Contour panels")}</Checkbox>
</div>
<Steps aria-label={("Panel stages")}
type="panel" {current} variant={outlined ? 'outlined' : 'filled'}
onChange={value => { current = value; }}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
- DocumentFinished
- CheckIn progress
- CompletionWaiting
- DocumentFinished
- CheckIn progress
- CompletionWaiting
Own icons and iconRender
items.icon accepts Snippet. iconRender gets the original icon and info; both forms are shown separately.
<script lang="ts">
import type { Snippet } from 'svelte';
import { Steps, type StepsIconInfo } from '@woodger/antd';
</script>
<style>
.stack {
display: grid;
gap: 28px;
}
</style>
{#snippet documentIcon()}
<svg
aria-hidden="true"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
><path
d="M5 3h10l4 4v14H5Zm3 8h8M8 15h8M8 18h5"
/></svg>
{/snippet}
{#snippet checkIcon()}
<svg aria-hidden="true" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.8"><path d="m5 12 4 4L19 6" /></svg>
{/snippet}
{#snippet iconRender(original: Snippet, info: StepsIconInfo)}
<span title={("Stage " + String((info.index + 1)) + ": " + String((info.active ? ("current") : info.item.status)) + "")}>
{@render original()}
</span>
{/snippet}
<div class="stack">
<Steps current={1} aria-label={("Stages with icons")} items={([
{ title: "Document", icon: documentIcon }, { title: "Check", icon: checkIcon },
{ title: "Completion", icon: checkIcon }
])} />
<Steps
current={1}
{iconRender}
aria-label={("Stages with icon renderer")}
items={([{ title: "Document" }, { title: "Check" }, { title: "Completion" }])}
/>
</div>
- DataFinishedAccepted
- Check Текущий этапIn progressIn progress
- ReadyWaitingAwaiting 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.
<script lang="ts">
import { Steps, type StepsOrientation } from '@woodger/antd';
let percent = $state(40);
let titlePlacement = $state<StepsOrientation>('horizontal');
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 20px;
}
label {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
</style>
<div class="controls">
<label>{("Position of labels ")}<select bind:value={titlePlacement}>
<option value="horizontal">
{("Side")}
</option>
<option value="vertical">
{("Below the icon")}
</option>
</select></label>
<label>{("Stage progress ")}<input
type="range"
min="0"
max="100"
bind:value={percent}
/>
<output>{percent}%</output>
</label>
</div>
<Steps
current={1}
{titlePlacement}
{percent}
aria-label={("Progress of the current stage")}
items={([
{ title: "Data", content: "Accepted" },
{ title: "Check", content: "In progress", subTitle: "Current stage" },
{ title: "Ready", content: "Awaiting verification" }
])}
/>
- FinishedDescription 1
- Finished
- In progressDescription 4
- Waiting
- WaitingDescription 8
Limitation of the number of stages
maxCount collapses hidden ranges into inaccessible ellipses. current stores the index of the original list.
<script lang="ts">
import { Steps, Button } from '@woodger/antd';
let current = $state(3);
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
output {
display: block;
margin-top: 16px;
}
</style>
<div class="controls">
<Button onclick={() => { current = Math.max(0, current - 1); }}>
{("Previous initial stage")}
</Button>
<Button onclick={() => { current = Math.min(7, current + 1); }}>
{("Next initial stage")}
</Button>
</div>
<Steps aria-label={("Shortened steps")}
{current} maxCount={3} onChange={value => { current = value; }}
items={([
...Array.from({ length: 8 }, (_, index) => ({
key: index, title: `Stage ${index + 1}`, content: `Description ${index + 1}`
}))
])}
/>
<output
aria-label={("Source index Steps")}
>{("Index ")}{current}{(" from 0–7")}</output>
- FinishedFill in the details
- In progressCheck the result
- WaitingComplete the action
Dots instead of numbers
type=dot leaves compact marks. The stage selection updates current via a public callback.
<script lang="ts">
import { Steps } from '@woodger/antd';
let current = $state(1);
</script>
<Steps aria-label={("Stages with dots")}
type="dot" {current} onChange={value => { current = value; }}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
- Fill in the detailsDataFinishedFill in the details
- Check the resultCheckIn progressCheck the result
- Complete the actionReadyWaitingComplete 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.
<script lang="ts">
import { Steps } from '@woodger/antd';
</script>
<Steps aria-label={("Compact Stages")}
type="inline" current={1}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
Project | Stages |
|---|---|
| Выпуск библиотеки |
|
| Страница проекта |
|
Compact stages in table
Each record has its own current stage. Table allows horizontal scrolling on a narrow screen.
<script lang="ts">
import { Steps, Table } from '@woodger/antd';
interface Task {
key: string;
name: string;
current: number;
}
const tasks: readonly Task[] = [
{ key: 'release', name: "Library release", current: 1 },
{ key: 'homepage', name: "Project page", current: 2 }
];
</script>
{#snippet stages(task: Task)}
<Steps type="inline" current={task.current} aria-label={("Stages: " + String((task.name)) + "")} items={([
{ title: "Preparation" }, { title: "Check" }, { title: "Ready" }
])} />
{/snippet}
<Table dataSource={(tasks)} pagination={(false)} caption={("Project stages")} scroll={{
x: 520
}}
columns={([
{ key: 'name', title: "Project", dataIndex: 'name', width: 220 },
{ key: 'stages', title: "Stages", render: stages }
])}
/>
- DataFinished
- CheckIn progress
- ReadyWaiting
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.
<script lang="ts">
import { Steps, Checkbox } from '@woodger/antd';
let bold = $state(true);
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
</style>
<div
class="controls"
><Checkbox
bind:checked={bold}
>{("Bold Headings Steps")}</Checkbox></div>
<Steps aria-label={("Designed stages")}
current={1} classNames={{ root: 'semantic-steps-root' }}
styles={() => ({
root: `
padding: 16px;
border: 1px solid var(--ant-color-primary-border);
border-radius: 8px;
`,
itemTitle: `font-weight:${bold ? 700 : 400}`
})}
items={([
{ title: "Data" },
{
title: "Check", classNames: { title: 'semantic-step-title' },
styles: { title: 'text-decoration:underline' }
},
{ title: "Ready" }
])}
/>
- DataFinished
- CheckIn progress
- ReadyWaiting
Component tokens
Local theme changes the size of the normal and current point. The settings of neighboring cards are saved.
<script lang="ts">
import { ConfigProvider, Steps } from '@woodger/antd';
let currentSize = $state(16);
</script>
<style>
label {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin-bottom: 20px;
}
</style>
<label>{("Current point size ")}<input
type="range"
min="12"
max="20"
bind:value={currentSize}
/>
<output>{currentSize}px</output>
</label>
<ConfigProvider theme={{
cssVar: {}, components: {
Steps: {
dotSize: 10,
dotCurrentSize: currentSize
}
}
}}>
<Steps type="dot" current={1} aria-label={("Stages with your own theme")} items={([
{ title: "Data" }, { title: "Check" }, { title: "Ready" }
])} />
</ConfigProvider>
- FinishedFill in the details
- In progressCheck the result
- WaitingComplete the action
Start index
initial shifts the numbering. onChange returns the index based on initial, not the position in the local array.
<script lang="ts">
import { Steps } from '@woodger/antd';
let current = $state(6);
</script>
<style>
output {
display: block;
margin-top: 16px;
}
</style>
<Steps aria-label={("Stages with starting index")}
initial={5} {current} onChange={value => { current = value; }}
items={([
{ key: 'data', title: "Data", content: "Fill in the details" },
{ key: 'review', title: "Check", content: "Check the result" },
{ key: 'done', title: "Ready", content: "Complete the action" }
])}
/>
<output
aria-label={("Index with offset Steps")}
>initial: 5; current: {current}</output>
- FinishedDescription of the stage 1
- Finished
- In progressDescription of the stage 4
- Waiting
- WaitingDescription of the stage 8
Review options
Saved example of switching five types Steps, outline and maxCount.
<script lang="ts">
import { Steps, Select } from '@woodger/antd';
import type { StepsType } from '@woodger/antd';
let type = $state<StepsType>('dot');
let current = $state(3);
</script>
<div style="margin-top:24px">
<Select
aria-label={("Option Steps")}
bind:value={type}
options={(['default', 'dot', 'inline', 'navigation', 'panel']
.map(value => ({ value: value as StepsType, label: value })))}
style="
width: 160px;
margin-bottom: 16px;
"
/>
<Steps
aria-label={("Extended stages")}
{type}
variant="outlined"
{current}
maxCount={3}
onChange={index => { current = index; }}
items={(Array.from(
{ length: 8 },
(_, index) =>
({ title: `Stage ${index + 1}`, content: `Description of the stage ${index + 1}` })
))}
/>
</div>
- FinishedFill out the form
- In progressData can be changed before sending.
- WaitingComplete the process
Application step by step
- In progressFill out the form
- WaitingCheck application
- WaitingSubmit your request
Application data
Application step by step
Saved review example: form check, edit, submit error, redo and reset.
<script lang="ts">
import { onDestroy, tick } from 'svelte';
import {
Button,
Checkbox,
Form,
FormItem,
Input,
Result,
Select,
Steps,
type StepsItem,
type StepsOrientation,
type StepsSize,
type StepsStatus
} from '@woodger/antd';
import { createStepsWizard } from './steps-wizard.model.svelte';
const model = createStepsWizard(message => (message));
let previewCurrent = $state(1);
let orientation = $state<StepsOrientation>('horizontal');
let size = $state<StepsSize>('medium');
let status = $state<StepsStatus>('process');
let clickable = $state(true);
let fail = $state(false);
let panel = $state<HTMLDivElement>();
let active = true;
let action = 0;
let items = $derived<StepsItem[]>(
[
{
key: 'data',
title: "Data",
content: "Fill out the form",
disabled: model.busy
},
{
key: 'review',
title: "Check",
content: "Check application",
disabled: model.busy || model.unlocked < 1
},
{
key: 'send',
title: "Dispatch",
content: "Submit your request",
disabled: model.busy || model.unlocked < 2
}
]
);
onDestroy(() => {
active = false;
action++;
model.destroy();
});
async function focusPanel(token: number) {
await tick();
if (!active || token !== action) {
return;
}
const invalid = panel?.querySelector<HTMLElement>('[aria-invalid="true"]');
(invalid ?? (
model.current === 0
? document.getElementById('steps-example-name')
: panel
))
?.focus({ preventScroll: true });
}
async function goTo(index: number) {
const token = ++action;
const changed = await model.goTo(index);
if (changed || model.validationFailed) await focusPanel(token);
}
function acceptData() { if (model.acceptData()) void focusPanel(++action); }
function review() { if (model.review()) void focusPanel(++action); }
async function send() {
const token = ++action;
if (await model.send(fail) || model.validationFailed) await focusPanel(token);
}
function reset() {
action++;
model.reset();
fail = false;
}
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
}
.workflow-controls { margin-top: 16px; }
.field { width: 180px; }
.preview,
.workflow {
margin-block: 24px;
padding: 20px;
border: 1px solid var(--ant-color-border-secondary);
border-radius: var(--ant-border-radius-lg);
min-width: 0;
}
.workflow:focus-visible {
outline: 2px solid var(--ant-color-primary);
outline-offset: 3px;
}
.form {
max-width: 440px;
margin-inline: auto;
}
.workflow :global(.ant-btn) {
max-width: 100%;
height: auto;
min-height: var(--ant-control-height);
white-space: normal;
}
.workflow :global(.ant-btn-sm) { min-height: var(--ant-control-height-sm); }
.workflow :global(.ant-btn-lg) { min-height: var(--ant-control-height-lg); }
.summary { overflow-wrap: anywhere; }
output {
display: block;
margin-top: 16px;
color: var(--ant-color-text-secondary);
}
</style>
{#snippet previewTitle()}<strong>{("Check")}</strong>{/snippet}
{#snippet previewContent()}
<span>
{("Data can be changed before sending.")}
</span>
{/snippet}
{#snippet completionActions()}<Button type="primary" onclick={() => { void goTo(0); }}>
{("Change application details")}
</Button>{#if model.status === 'error'}<Button
loading={model.busy}
onclick={() => { void send(); }}
>{("Resubmit the application")}</Button>{/if}{/snippet}
<div class="controls"><div class="field"><Select
aria-label={("Orientation Steps")}
bind:value={orientation}
options={([
{ value: 'horizontal', label: "Horizontal" },
{ value: 'vertical', label: "Vertical" }
])}
/></div><div class="field"><Select
aria-label={("Size Steps")}
bind:value={size}
options={([{ value: 'medium', label: 'medium' }, {
value: 'small',
label: 'small'
}])}
/></div><div
class="field"
><Select
aria-label={("Status Steps")}
bind:value={status}
options={(['wait', 'process', 'finish', 'error']
.map(value => ({ value: value as StepsStatus, label: value })))}
/></div><Checkbox
bind:checked={clickable}
>{("Selecting a step in Steps")}</Checkbox></div>
<div class="preview"><Steps
current={previewCurrent}
{status}
{orientation}
{size}
onChange={clickable ? value => { previewCurrent = value; } : undefined}
aria-label={("Preview Steps")}
items={([
{ key: 'data', title: "Data", content: "Fill out the form" },
{
key: 'review',
title: previewTitle,
subTitle: "Before shipping",
content: previewContent
},
{ key: 'send', title: "Dispatch", content: "Complete the process" }
])}
/></div>
<h3>{("Application step by step")}</h3>
<Steps
items={(items)}
current={model.current}
status={model.status === 'error' ? 'error' : 'process'}
onChange={index => { void goTo(index); }}
aria-label={("Application stages")}
/>
<div
class="controls workflow-controls"
><Checkbox
bind:checked={fail}
disabled={model.busy}
>{("Error sending Steps")}</Checkbox><Button
onclick={reset}
>{("Reset example Steps")}</Button></div>
<div
class="workflow"
bind:this={panel}
role="region"
aria-label={("Current application stage")}
tabindex="-1"
aria-busy={model.busy || undefined}
>
{#if model.current === 3 || model.status === 'error'}
<Result
status={model.status === 'error' ? 'error' : 'success'}
title={(model.status === 'error'
? "Failed to submit application step by step"
: "Application step by step sent")}
subTitle={("" + String((model.submitted?.name)) + ", " + String((model.submitted?.email)) + "")}
headingLevel={4}
extra={(completionActions)}
><p>{(model.status === 'error'
? "Fields saved. Uncheck the error box and resubmit."
: "All stages are completed. You can go back to editing.")}</p></Result>
{:else if model.current === 0}
<div class="form"><h4>{("Application data")}</h4><Form
form={model.form}
onFinish={acceptData}
aria-label={("Multi-step order data")}
><FormItem
name="name"
label={("Name in multi-step order")}
htmlFor="steps-example-name"
help={("Participant name.")}
><Input
value={model.form.values.name}
onValueChange={value => model.form.setFieldValue('name', value)}
/></FormItem><FormItem
name="email"
label={("Email in a multi-step application")}
htmlFor="steps-example-email"
help={("name@example.com")}
><Input
type="email"
value={model.form.values.email}
onValueChange={value => model.form.setFieldValue('email', value)}
/></FormItem><Button
type="primary"
htmlType="submit"
loading={model.form.isSubmitting}
>{("Check application details")}</Button></Form></div>
{:else if model.current === 1}
<h4>{("Application verification")}</h4><p class="summary">{("Name: ")}{model
.form.values.name}. Email: {model.form.values.email}.</p><div
class="controls"
><Button
onclick={() => { void goTo(0); }}
>{("Back to data")}</Button><Button
type="primary"
onclick={review}
>{("To submit an application")}</Button></div>
{:else}
<h4>{("Submitting an application")}</h4><p class="summary">{model.form.values.name}, {model
.form.values.email}</p><div
class="controls"
><Button
disabled={model.busy}
onclick={() => { void goTo(1); }}
>{("Back to check")}</Button><Button
type="primary"
loading={model.busy}
onclick={() => { void send(); }}
>{("Submit a multi-step application")}</Button></div>
{/if}
</div>
<output aria-label={("Result of Steps example")}>{("Stage: ")}{(model.current)}{(". Condition: ")}{(model.status)}.</output>
- Finished
- In progress
- Waiting
- DataFinished
- CheckIn progress
- ReadyWaiting
- DataFinished
- CheckIn progress
- ReadyWaiting
General settings Steps
ConfigProvider.steps, callback current props, local and item-specific styles, reset record.
<script lang="ts">
import { Checkbox, ConfigProvider, Steps } from '@woodger/antd';
let emphasized = $state(true);
let current = $state(1);
const items = [{ title: "Data" }, { title: "Check" }, { title: "Ready" }];
</script>
<style>
.example, .examples {
display: grid;
gap: 24px;
}
</style>
<div class="example">
<Checkbox bind:checked={emphasized}>{("Heading Emphasis Steps")}</Checkbox>
<ConfigProvider steps={({
class: 'shared-steps', style: 'padding: 12px',
classNames: { itemTitle: 'shared-steps-title' },
styles: ({ props }) => ({
itemTitle: props.current === 1 && emphasized
? 'font-weight: 700'
: 'font-weight: 400'
})
})}>
<div class="examples">
<Steps
aria-label={("Stages with defaults")}
{current}
items={(items)}
onChange={value => { current = value; }}
/>
<Steps aria-label={("Stages with local style")} {current}
classNames={{ itemTitle: 'local-steps-title' }}
styles={{ itemTitle: 'font-weight: 400' }}
style="padding: 20px"
items={([...items.slice(0, 2), {
title: "Ready", styles: {
title: 'font-weight: 800'
}
}])} />
<ConfigProvider steps={({})}>
<Steps aria-label={("Stages without defaults")} {current} items={(items)} />
</ConfigProvider>
</div>
</ConfigProvider>
</div>
- Finished
- In progress
- Waiting
- DataFinished
- CheckIn progress
- ReadyWaiting
Local CSS prefix
Change namespace, progress, stage selection and standard neighbor; empty prefixCls inherits ConfigProvider.
<script lang="ts">
import { Checkbox, Steps } from '@woodger/antd';
let custom = $state(true);
let alternate = $state(false);
let current = $state(1);
const items = [
{ key: 'data', title: "Data" },
{ key: 'review', title: "Check" },
{ key: 'done', title: "Ready" }
];
let prefix = $derived(
custom
? (alternate ? 'project-steps' : 'woodger-steps')
: ''
);
</script>
<style>
.example {
display: grid;
gap: 24px;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("Custom prefix Steps")}</Checkbox>
<Checkbox bind:checked={alternate} disabled={!custom}>
{("Alternative prefix Steps")}
</Checkbox>
</div>
<Steps
prefixCls={prefix}
aria-label={("Stages with prefix")}
{current}
items={(items)}
percent={50}
classNames={{ itemTitle: 'prefix-steps-title' }}
styles={{ root: 'padding: 12px' }}
onChange={value => { current = value; }}
/>
<Steps
aria-label={("Standard stages nearby")}
{current}
items={(items)}
percent={50}
/>
<output
aria-label={("Select stages with prefix")}
>{("Index ")}{current}; prefixCls: {(prefix
|| ("from ConfigProvider"))}</output>
</div>
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.
| Theme | Example or limitation |
|---|---|
| Basic | Current stage and automatic statuses. |
| Error status | Error and retry. |
| Vertical | Orientation and small size. |
| Clickable | Controlled selection, disabled and keyboard. |
| Panel Steps | Horizontal panels and filled/outlined options. |
| With icon | items.icon and iconRender. |
| Title Placement and Progress | Captions, subTitle and percent. |
| Max Count | Collapse ranges while maintaining the index. |
| Dot Style | Dots via type="dot". |
| Navigation Steps | Navigation type. |
| Inline Steps | Compact status. |
| Inline Style Combination | Several inline sequences in Table. |
| Custom semantic dom styling | General and individual semantic styles. |
| Component config | General class/style, callback semantic defaults and local priorities. |
| Local CSS prefix | Change the CSS prefix while maintaining the selection, identifiers and standard neighbor. |
| Property | Description | Type | Default |
|---|---|---|---|
prefixCls | Full 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. | string | ConfigProvider + -steps |
items | Stage data; empty conditional entries are skipped. | readonly (StepsItem | StepsDataItem | false | null | undefined)[] | [] |
current | Current source index taking into account initial. Two-way binding is not provided. | number | 0 |
onChange | The application itself updates current. Without callback stages are informational if item.onClick is not set. | (index: number) => void | — |
initial | Starting index of numbering and current stage. | number | 0 |
status | Current stage status; item.status overrides automatic. | 'wait' | 'process' | 'finish' | 'error' | process |
orientation | Horizontal or vertical sequence of steps. | 'horizontal' | 'vertical' | horizontal |
titlePlacement | Position of headings and content: next to or below icons. | 'horizontal' | 'vertical' | horizontal |
type | Representation type. | 'default' | 'dot' | 'inline' | 'navigation' | 'panel' | default |
variant | Filled or outline design. | 'filled' | 'outlined' | filled |
size | Size of stages. | 'medium' | 'small' | From ConfigProvider |
responsive | When the viewport is already 532px, switches supported types to vertical; panel is always horizontal. | boolean | true |
percent | Progress of the current process stage; inline does not use percent. | number | — |
maxCount | Limiting visible stages from three; hidden ranges are replaced with disabled ellipses. | number | — |
iconRender | Snippet gets originalElement and StepsIconInfo. items.icon is preferable. | StepsIconRender | — |
disabled | Disables stage selection. | boolean | From ConfigProvider |
classNames | Root classes and semantic slots of each stage. | StepsSemanticSlots | (info) => StepsSemanticSlots | ConfigProvider.steps |
styles | CSS lines semantic slots. | StepsSemanticSlots | (info) => StepsSemanticSlots | ConfigProvider.steps |
nativeElement | bind: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.
| Token | Purpose |
|---|---|
customIconFontSize | Custom icon font size. |
customIconSize | Custom icon container size. |
customIconTop | Vertical offset of the custom icon. |
dotCurrentSize | Size of the current point. |
dotSize | Regular dot size. |
iconFontSize | Icon font size. |
iconSize | Regular icon size. |
iconSizeSM | Small icon size. |
iconTop | Vertical offset of the icon. |
navArrowColor | Navigation arrow color. |
navContentMaxWidth | Maximum width of navigation content. |
| Token | Current value |
|---|---|
colorBgContainer | #ffffff |
colorError | #ff4d4f |
colorErrorBg | #fff2f0 |
colorErrorBgFilledHover | #ffdfdc |
colorErrorHover | #ff7875 |
colorFillTertiary | rgba(0,0,0,0.04) |
colorPrimary | #2f54eb |
colorPrimaryBg | #f0f5ff |
colorPrimaryBgHover | #d6e4ff |
colorPrimaryBorder | #adc6ff |
colorPrimaryHover | #597ef7 |
colorSplit | rgba(5,5,5,0.06) |
colorText | rgba(0,0,0,0.88) |
colorTextDescription | rgba(0,0,0,0.45) |
colorTextDisabled | rgba(0,0,0,0.25) |
colorTextLabel | rgba(0,0,0,0.65) |
colorTextLightSolid | #fff |
colorTextQuaternary | rgba(0,0,0,0.25) |
colorTextSecondary | rgba(0,0,0,0.65) |
borderRadius | 6 |
borderRadiusSM | 4 |
controlHeight | 32 |
controlItemBgHover | rgba(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' |
fontSize | 14 |
fontSizeIcon | 12 |
fontSizeLG | 16 |
fontSizeSM | 12 |
lineHeight | 1.5714285714285714 |
lineHeightLG | 1.5 |
lineHeightSM | 1.6666666666666667 |
lineType | solid |
lineWidth | 1 |
lineWidthBold | 2 |
lineWidthFocus | 3 |
margin | 16 |
marginSM | 12 |
marginXS | 8 |
marginXXS | 4 |
motionDurationMid | 0.2s |
motionDurationSlow | 0.3s |
paddingSM | 12 |
paddingXS | 8 |
paddingXXS | 4 |
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.