+`;
+
exports[`renders ./components/steps/demo/label-placement.md correctly 1`] = `
Array [
(
+
+
(
+
+ }
+ title={{item.title}}
+ description="Ant Design, a design language for background applications, is refined by Ant UED Team"
+ />
+
+
+ )}
+ />
+
+);
+
+export default App;
+```
diff --git a/components/steps/index.en-US.md b/components/steps/index.en-US.md
index 8a89614846..0f035650bd 100644
--- a/components/steps/index.en-US.md
+++ b/components/steps/index.en-US.md
@@ -50,10 +50,21 @@ The whole of the step bar.
| responsive | Change to vertical direction when screen width smaller than `532px` | boolean | true | |
| size | To specify the size of the step bar, `default` and `small` are currently supported | string | `default` | |
| status | To specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` | |
-| type | Type of steps, can be set to one of the following values: `default`, `navigation` | string | `default` | |
+| type | Type of steps, can be set to one of the following values: `default` `navigation` `inline` | string | `default` | inline: 5.0 |
| onChange | Trigger when Step is changed | (current) => void | - | |
| items | StepItem content | [StepItem](#StepItem) | [] | 4.24.0 |
+### `type="inline"`
+
+| Property | Description | Type | Default | Version |
+| --- | --- | --- | --- | --- |
+| className | Additional class to Steps | string | - | |
+| current | To set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | number | 0 | |
+| initial | Set the initial step, counting from 0 | number | 0 | |
+| status | To specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` | |
+| onChange | Trigger when Step is changed | (current) => void | - | |
+| items | StepItem content. not supported: `icon` `subtitle` | [StepItem](#StepItem) | [] | 4.24.0 |
+
### StepItem
A single step in the step bar.
diff --git a/components/steps/index.tsx b/components/steps/index.tsx
index ce108d75a1..e9ecc66482 100644
--- a/components/steps/index.tsx
+++ b/components/steps/index.tsx
@@ -4,6 +4,7 @@ import classNames from 'classnames';
import RcSteps from 'rc-steps';
import type { ProgressDotRender } from 'rc-steps/lib/Steps';
import * as React from 'react';
+import Tooltip from '../tooltip';
import { ConfigContext } from '../config-provider';
import useBreakpoint from '../grid/hooks/useBreakpoint';
import Progress from '../progress';
@@ -23,7 +24,7 @@ export interface StepProps {
}
export interface StepsProps {
- type?: 'default' | 'navigation';
+ type?: 'default' | 'navigation' | 'inline';
className?: string;
current?: number;
direction?: 'horizontal' | 'vertical';
@@ -70,13 +71,15 @@ const Steps: StepsType = props => {
const [wrapSSR, hashId] = useStyle(prefixCls);
+ const isInline = props.type === 'inline';
const iconPrefix = getPrefixCls('', props.iconPrefix);
const mergedItems = useLegacyItems(items, children);
+ const mergedPercent = isInline ? undefined : percent;
const stepsClassName = classNames(
{
[`${prefixCls}-rtl`]: rtlDirection === 'rtl',
- [`${prefixCls}-with-progress`]: percent !== undefined,
+ [`${prefixCls}-with-progress`]: mergedPercent !== undefined,
},
className,
hashId,
@@ -96,7 +99,7 @@ const Steps: StepsType = props => {
title: string | React.ReactNode;
description: string | React.ReactNode;
}) => {
- if (status === 'process' && percent !== undefined) {
+ if (status === 'process' && mergedPercent !== undefined) {
// currently it's hard-coded, since we can't easily read the actually width of icon
const progressWidth = size === 'small' ? 32 : 40;
// iconWithProgress
@@ -104,7 +107,7 @@ const Steps: StepsType = props => {