Stepper Item
<afp-stepper-item>
A stepper-item component to be used as a child of afp-stepper.
The afp-stepper-item component represents a single step in a stepper process. Steps are child elements of afp-stepper and manage their own visual state and interactions.
Examples #
Variants #
Use the variant attribute to set the step's semantic variant.
Shapes #
Use the shape attribute to set the step's shape. The default shape is pill.
Sizes #
Use the size attribute to set the step's size. The default size is medium.
Active #
Use the active attribute to indicate the current step in the process.
Label #
Use the label attribute to provide a descriptive label for the step.
Custom Number #
Use the number attribute to set a custom number for the step. By default, the step number is determined by its position within the afp-stepper, but you can override this with a custom value.
Connector #
Use the connector attribute to display a connector line between steps. The connector will only be visible if the step is not the last child of afp-stepper.
Disabled #
Use the disabled attribute to disable a step, indicating that it is not available for interaction.
Completed #
Use the completed attribute to indicate that a step has been completed.
Invalid #
Use the invalid attribute to indicate that a step has an error.
Properties
Learn more about properties.
| Name | Description | Reflects | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
index
|
Index of the step in the stepper
Type
number
Default
0 |
|
||||||||||||||||
number
|
Custom number to display in the step button
If not provided, the step index + 1 will be used
Type
number | undefined
|
|
||||||||||||||||
variant
|
The variant of the step button
Type
AfpVariant
Default
AfpVariant.NEUTRAL |
|
||||||||||||||||
shape
|
Shape of the step
Type
AfpShape
Default
AfpShape.PILL |
|
||||||||||||||||
size
|
Size of the step
Type
AfpSize
Default
AfpSize.MEDIUM |
|
||||||||||||||||
connector
|
indiacates whether to show connector or not
Type
boolean
Default
false |
|
||||||||||||||||
active
|
active indicates whether the step is currently active.
Type
boolean
Default
false |
|
||||||||||||||||
disabled
|
disabled indicates whether the step is disabled and cannot be interacted with.
Type
boolean
Default
false |
|
||||||||||||||||
completed
|
completed indicates whether the step has been completed.
Type
boolean
Default
false |
|
||||||||||||||||
invalid
|
error indicates whether the step has a validation error.
Type
string
Default
'' |
|
||||||||||||||||
content
|
The name of the stepper content associated with this stepper item.
Used to link this stepper item with its corresponding afp-stepper-content.
Type
string
Default
'' |
|
||||||||||||||||
orientation
|
Orientation of the stepper
Type
AfpOrientation
Default
AfpOrientation.HORIZONTAL |
|
Events
Learn more about events.
| Name | Return | Description |
|---|---|---|
afp-select
|
number
|
Emitted when the step is selected, with the step index as detail.
|
Slots
Learn more about slots.
| Name | Description |
|---|---|
default
|
The default slot for step content.
|
completed-icon
|
The slot for a custom completed icon when the step is marked as completed.
|
CSS Parts
Learn more about CSS Parts.
| Name | Description | Selector |
|---|---|---|
base
|
The base element of the step.
|
::part(base)
|
step-header
|
The header element containing the step button and label.
|
::part(step-header)
|
step-header-wrapper
|
The wrapper around the step button and label for layout purposes.
|
::part(step-header-wrapper)
|
step-header-button
|
The button element representing the step.
|
::part(step-header-button)
|
step-header-completed-icon
|
The icon displayed when the step is completed.
|
::part(step-header-completed-icon)
|
step-header-number
|
The number displayed in the step button when not completed.
|
::part(step-header-number)
|
step-label
|
The container for the step label and error message.
|
::part(step-label)
|
content
|
The slot for the step label content.
|
::part(content)
|
invalid
|
The error message displayed when the step is invalid.
|
::part(invalid)
|
step-connector
|
The connector line between steps when `connector` is true.
|
::part(step-connector)
|
CSS Custom Properties
| Name | Description | Default |
|---|---|---|
--afp-stepper-item-inactive-color
|
The color of inactive steps and connectors.
|
--afp-color-text
|
--afp-stepper-item-connector-color
|
The color of the connector lines.
|
--afp-color-base-500
|
--afp-stepper-item-connector-thickness
|
The thickness of connector lines.
|
--afp-border-width-s
|
--afp-stepper-item-vertical-label-width
|
The width of step labels in vertical orientation.
|
--afp-size-3xl
|
--afp-stepper-item-connector-height
|
The height of connector lines.
|
2px
|
Dependencies
The component automatically brings in the listed items, including any nested dependencies that may exist.
| Component | CSS Part Prefix |
|---|---|
|
|
step-header-button
- The button element representing the step.
|
|
|
step-header-completed-icon
- The icon displayed when the step is completed.
|
Importing
Using the bundle is the recommended method to include components. If you’d rather handle imports manually, you can use the code examples below.
import '@afp-design-system/core/dist/components/stepper-item/stepper-item.js';