<div class="lui-stepper" data-controller="stepper"> <div class="lui-stepper__container"> <div class="lui-stepper__step lui-stepper__step--previous" data-stepper-target="step" data-controller="lui--step"> <div class="lui-stepper__step__indicator_wrapper"> <div class="lui-stepper__step__indicator" data-stepper-index-value="0"> <span class="lui-stepper__step__indicator_number">1</span> <i class="lui-m_icon lui-stepper__step__indicator_icon material-symbols-outlined" style="--lui-micon-size: 14px;"> check </i> </div> <div class="lui-stepper__step__indicator_line"></div> </div> <div class="lui-stepper__step__body"> <div class="lui-stepper__step__header"> <div class="lui-header lui-header--small"> <div class="lui-header__title_container"> <span class="lui-header__title_container__title"> Step 1 </span> </div> <span class="lui-header__description"> Description 1 </span> </div> </div> <div class="lui-stepper__step__buttons"> <button class="lui-button lui-button--neutral--secondary lui-button--size-tiny w-full w-full relative" data-controller="lui--button"> <span class="lui-button__text opacity-100 inline-flex" data-lui--button-target="text"> Back </span> <div class="absolute w-full flex items-center justify-center opacity-0" data-lui--button-target="loadingIcon"> <i class="lui-m_icon animate-spin material-symbols-outlined" style="--lui-micon-size: 12px;"> progress_activity </i> </div> </button> <button class="lui-button lui-button--neutral--primary lui-button--size-tiny w-full w-full relative" data-controller="lui--button"> <span class="lui-button__text opacity-100 inline-flex" data-lui--button-target="text"> Next </span> <div class="absolute w-full flex items-center justify-center opacity-0" data-lui--button-target="loadingIcon"> <i class="lui-m_icon animate-spin material-symbols-outlined" style="--lui-micon-size: 12px;"> progress_activity </i> </div> </button> </div> </div> </div> <div class="lui-stepper__step lui-stepper__step--previous" data-stepper-target="step" data-controller="lui--step"> <div class="lui-stepper__step__indicator_wrapper"> <div class="lui-stepper__step__indicator" data-stepper-index-value="1"> <span class="lui-stepper__step__indicator_number">2</span> <i class="lui-m_icon lui-stepper__step__indicator_icon material-symbols-outlined" style="--lui-micon-size: 14px;"> check </i> </div> <div class="lui-stepper__step__indicator_line"></div> </div> <div class="lui-stepper__step__body"> <div class="lui-stepper__step__header"> <div class="lui-header lui-header--small"> <div class="lui-header__title_container"> <span class="lui-header__title_container__title"> Step 2 </span> </div> <span class="lui-header__description"> Description 2 </span> </div> </div> <div class="lui-stepper__step__buttons"> <button class="lui-button lui-button--neutral--secondary lui-button--size-tiny w-full w-full relative" data-controller="lui--button"> <span class="lui-button__text opacity-100 inline-flex" data-lui--button-target="text"> Back </span> <div class="absolute w-full flex items-center justify-center opacity-0" data-lui--button-target="loadingIcon"> <i class="lui-m_icon animate-spin material-symbols-outlined" style="--lui-micon-size: 12px;"> progress_activity </i> </div> </button> <button class="lui-button lui-button--neutral--primary lui-button--size-tiny w-full w-full relative" data-controller="lui--button"> <span class="lui-button__text opacity-100 inline-flex" data-lui--button-target="text"> Next </span> <div class="absolute w-full flex items-center justify-center opacity-0" data-lui--button-target="loadingIcon"> <i class="lui-m_icon animate-spin material-symbols-outlined" style="--lui-micon-size: 12px;"> progress_activity </i> </div> </button> </div> </div> </div> <div class="lui-stepper__step lui-stepper__step--open lui-stepper__step--current lui-stepper__step--active" data-stepper-target="step" data-controller="lui--step"> <div class="lui-stepper__step__indicator_wrapper"> <div class="lui-stepper__step__indicator" data-stepper-index-value="2"> <span class="lui-stepper__step__indicator_number">3</span> <i class="lui-m_icon lui-stepper__step__indicator_icon material-symbols-outlined" style="--lui-micon-size: 14px;"> check </i> </div> <div class="lui-stepper__step__indicator_line"></div> </div> <div class="lui-stepper__step__body"> <div class="lui-stepper__step__header"> <div class="lui-header lui-header--small"> <div class="lui-header__title_container"> <span class="lui-header__title_container__title"> Step 3 </span> </div> <span class="lui-header__description"> Description 3 </span> </div> </div> <div class="lui-stepper__step__content" data-lui--step-target="content"> <div class="w-full w-full lui-dummy_slot text-[#78818a] text-primary-xs-bold leading-none"> SLOT </div> </div> <div class="lui-stepper__step__buttons"> <button class="lui-button lui-button--neutral--secondary lui-button--size-tiny w-full w-full relative" data-controller="lui--button"> <span class="lui-button__text opacity-100 inline-flex" data-lui--button-target="text"> Back </span> <div class="absolute w-full flex items-center justify-center opacity-0" data-lui--button-target="loadingIcon"> <i class="lui-m_icon animate-spin material-symbols-outlined" style="--lui-micon-size: 12px;"> progress_activity </i> </div> </button> <button class="lui-button lui-button--neutral--primary lui-button--size-tiny w-full w-full relative" data-controller="lui--button"> <span class="lui-button__text opacity-100 inline-flex" data-lui--button-target="text"> Next </span> <div class="absolute w-full flex items-center justify-center opacity-0" data-lui--button-target="loadingIcon"> <i class="lui-m_icon animate-spin material-symbols-outlined" style="--lui-micon-size: 12px;"> progress_activity </i> </div> </button> </div> </div> </div> </div></div>Stepper
Description
Related components
| Used Components | Components where is Used |
|---|---|
| Label |
Usage rules
- ✅ Do
- ❌ Don't
<%= render LooposUi::Stepper.new(active_step: 2) do |stepper| %> <% stepper.with_step do |step| %> <% step.with_header(title: "Step 1", description: "Description 1") %> <%= render LooposUi::DummySlot.new(text: "SLOT") %> <% step.with_next_action %> <% step.with_previous_action %> <% end %> <% stepper.with_step do |step| %> <% step.with_header(title: "Step 2", description: "Description 2") %> <%= render LooposUi::DummySlot.new(text: "SLOT " * 100) %> <% step.with_next_action %> <% step.with_previous_action %> <% end %> <% stepper.with_step do |step| %> <% step.with_header(title: "Step 3", description: "Description 3") %> <%= render LooposUi::DummySlot.new(text: "SLOT") %> <% step.with_next_action %> <% step.with_previous_action %> <% end %><% end %>No notes provided.
| Param | Description | Input |
|---|---|---|
|
— |
|
Description
The Stepper component is used to display a sequence of steps in a process or workflow. It provides a visual representation of progress through multiple stages, allowing users to navigate between steps and see their current position.
Arguments
| Property | Default | Required | Description |
|---|---|---|---|
data |
{} |
No | Additional data attributes to be merged with the component's default data attributes. These will be applied to all the step number elements, for any extra actions to be done when the user clicks on a step. |
active_step |
1 |
No | The currently active step (1-based indexing). This determines which step content is visible and which step indicator is marked as current. |
Slots
steps (Multiple)
Step slots that render the content for each step in the stepper. Each step slot works as a container for all the elements that the programmer wants to put in the step.
header (Single)
Optional header slot for adding a title or description above the stepper.
JavaScript Events
The stepper uses Stimulus controllers to handle navigation. You can trigger these actions from other parts of your application:
Actions:
stepper#setStep- Selects a specific step when clicked (needs to be passed the desired step index)stepper#previousStep- Navigates to the previous step (with bounds checking)stepper#nextStep- Navigates to the next step (with bounds checking)
Navigation Buttons
When adding navigation buttons to your steps, use the predefined button presets. They will already have the correct styles and handle navigation automatically.
for_next_step
Creates a button that navigates to the next step in the stepper.
<%= render LooposUi::Button.for_next_step(text: "Next") %>