Importimport { Steps } from 'antd'; |
Importimport { Steps } from 'antd'; |
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.
Common props ref:Common props
The whole of the step bar.
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| classNames | Customize class for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string> | - | |
| current | To set the current step, counting from 0. You can overwrite this state by using status of Step | number | 0 | |
To specify the direction of the step bar, horizontal or vertical | string | horizontal | ||
| iconRender | Custom render icon, please use items.icon first | (oriNode, info: { index, active, item }) => ReactNode | - | |
| initial | Set the initial step, counting from 0 | number | 0 | |
Place title and content with horizontal or vertical direction | string | horizontal | ||
| orientation | To specify the orientation of the step bar, horizontal or vertical | string | horizontal | |
| percent | Progress circle percentage of current step in process status (only works on basic Steps) | number | - | 4.5.0 |
Steps with progress dot style, customize the progress dot by setting it to a function. Please use type="dot" instead. titlePlacement will be vertical | boolean | (iconDot, { index, status, title, content }) => ReactNode | false | ||
| responsive | Change to vertical direction when screen width smaller than 532px | boolean | true | |
| size | To specify the size of the step bar, medium and small are currently supported | string | medium | |
| status | To specify the status of current step, can be set to one of the following values: wait process finish error | string | process | |
| styles | Customize inline style for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties> | - | |
| titlePlacement | Place title and content with horizontal or vertical direction | string | horizontal | |
| type | Type of steps, can be set to one of the following values: default dot inline navigation panel | string | default | |
| variant | Config style variant | filled | outlined | filled | |
| onChange | Trigger when Step is changed | (current) => void | - | |
| items | StepItem content | StepItem | [] | 4.24.0 |
A single step in the step bar.
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| content | Description of the step, optional property | ReactNode | - | |
| Description of the step, optional property | ReactNode | - | ||
| disabled | Disable click | boolean | false | |
| icon | Icon of the step, optional property | ReactNode | - | |
| status | To specify the status. It will be automatically set by current of Steps if not configured. Optional values are: wait process finish error | string | wait | |
| subTitle | Subtitle of the step | ReactNode | - | |
| title | Title of the step | ReactNode | - |
| Token Name | Description | Type | Default Value |
|---|---|---|---|
| customIconFontSize | Font size of custom icon | number | 24 |
| customIconSize | Size of custom icon container | number | 32 |
| customIconTop | Top of custom icon | number | 0 |
| dotCurrentSize | Current size of dot | number | 10 |
| dotSize | Size of dot | number | 8 |
| iconFontSize | Size of icon | number | 14 |
| iconSize | Size of icon container | number | 32 |
| iconSizeSM | Size of small steps icon | string | number | 24 |
| iconTop | Top of icon | number | -0.5 |
| navArrowColor | Color of arrow in nav | string | rgba(0,0,0,0.25) |
| navContentMaxWidth | Max width of nav content | MaxWidth<string | number> | undefined | unset |
| Token Name | Description | Type | Default Value |
|---|---|---|---|
| colorBgContainer | Container background color, e.g: default button, input box, etc. Be sure not to confuse this with `colorBgElevated`. | string | #ffffff |
| colorError | Used to represent the visual elements of the operation failure, such as the error Button, error Result component, etc. | string | #ff4d4f |
| colorErrorBg | The background color of the error state. | string | #fff2f0 |
| colorErrorBgFilledHover | The wrong color fills the background color of the suspension state, which is currently only used in the hover effect of the dangerous filled button. | string | #ffdfdc |
| colorErrorHover | The hover state of the error color. | string | #ff7875 |
| colorFillTertiary | The third level of fill color is used to outline the shape of the element, such as Slider, Segmented, etc. If there is no emphasis requirement, it is recommended to use the third level of fill color as the default fill color. | string | rgba(0,0,0,0.04) |
| colorPrimary | Brand color is one of the most direct visual elements to reflect the characteristics and communication of the product. After you have selected the brand color, we will automatically generate a complete color palette and assign it effective design semantics. | string | #1677ff |
| colorPrimaryBg | Light background color of primary color, usually used for weak visual level selection state. | string | #e6f4ff |
| colorPrimaryBgHover | The hover state color corresponding to the light background color of the primary color. | string | #bae0ff |
| colorPrimaryHover | Hover state under the main color gradient. | string | #4096ff |
| colorSplit | Used as the color of separator, this color is the same as colorBorderSecondary but with transparency. | string | rgba(5,5,5,0.06) |
| colorText | Default text color which comply with W3C standards, and this color is also the darkest neutral color. | string | rgba(0,0,0,0.88) |
| colorTextDescription | Control the font color of text description. | string | rgba(0,0,0,0.45) |
| colorTextDisabled | Control the color of text in disabled state. | string | rgba(0,0,0,0.25) |
| colorTextLabel | Control the font color of text label. | string | rgba(0,0,0,0.65) |
| colorTextLightSolid | Control the highlight color of text with background color, such as the text in Primary Button components. | string | #fff |
| colorTextQuaternary | The fourth level of text color is the lightest text color, such as form input prompt text, disabled color text, etc. | string | rgba(0,0,0,0.25) |
| colorTextSecondary | The second level of text color is generally used in scenarios where text color is not emphasized, such as label text, menu text selection state, etc. | string | rgba(0,0,0,0.65) |
| borderRadius | Border radius of base components | number | 6 |
| borderRadiusSM | SM size border radius, used in small size components, such as Button, Input, Select and other input components in small size | number | 4 |
| controlHeight | The height of the basic controls such as buttons and input boxes in Ant Design | number | 32 |
| controlItemBgHover | Control the background color of control component item when hovering. | string | rgba(0,0,0,0.04) |
| fontFamily | The font family of Ant Design prioritizes the default interface font of the system, and provides a set of alternative font libraries that are suitable for screen display to maintain the readability and readability of the font under different platforms and browsers, reflecting the friendly, stable and professional characteristics. | string | -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 | The most widely used font size in the design system, from which the text gradient will be derived. | number | 14 |
| fontSizeIcon | Control the font size of operation icon in Select, Cascader, etc. Normally same as fontSizeSM. | number | 12 |
| fontSizeLG | Large font size | number | 16 |
| fontSizeSM | Small font size | number | 12 |
| lineHeight | Line height of text. | number | 1.5714285714285714 |
| lineHeightLG | Line height of large text. | number | 1.5 |
| lineHeightSM | Line height of small text. | number | 1.6666666666666667 |
| lineType | Border style of base components | string | solid |
| lineWidth | Border width of base components | number | 1 |
| lineWidthBold | The default line width of the outline class components, such as Button, Input, Select, etc. | number | 2 |
| margin | Control the margin of an element, with a medium size. | number | 16 |
| marginSM | Control the margin of an element, with a medium-small size. | number | 12 |
| marginXS | Control the margin of an element, with a small size. | number | 8 |
| marginXXS | Control the margin of an element, with the smallest size. | number | 4 |
| motionDurationMid | Motion speed, medium speed. Used for medium element animation interaction. | string | 0.2s |
| motionDurationSlow | Motion speed, slow speed. Used for large element animation interaction. | string | 0.3s |
| paddingSM | Control the small padding of the element. | number | 12 |
| paddingXS | Control the extra small padding of the element. | number | 8 |
| paddingXXS | Control the extra extra small padding of the element. | number | 4 |