Stepper

Description

Organizes tasks or processes into sequential steps, guiding users through a structured workflow or procedure.

PRO
This component is part of our professional component suite. See the installation instructions below for more on how to use it.

Arguments

Name Default Type Description
alignment vertical String The alignment of the steps
Options: vertical, horizontal
html_attributes {} Hash Any attributes for the used html wrapper tag

Examples

Default

<%= render Railsboot::StepperComponent.new do |stepper| %>
  <% stepper.with_item(active: true).with_content("Create account") %>
  <% stepper.with_item(active: true).with_content("Confirm email") %>
  <% stepper.with_item.with_content("Update profile") %>
  <% stepper.with_item.with_content("Finish") %>
<% end %>
<ol class="stepper">
  <li class="stepper-item active">Create account</li>
  <li class="stepper-item active">Confirm email</li>
  <li class="stepper-item">Update profile</li>
  <li class="stepper-item">Finish</li>
</ol>

Horizontal

<%= render Railsboot::StepperComponent.new(alignment: "horizontal") do |stepper| %>
  <% stepper.with_item(active: true).with_content("Create account") %>
  <% stepper.with_item(active: true).with_content("Confirm email") %>
  <% stepper.with_item.with_content("Update profile") %>
  <% stepper.with_item.with_content("Finish") %>
<% end %>
<ol class="stepper stepper-horizontal">
  <li class="stepper-item active">Create account</li>
  <li class="stepper-item active">Confirm email</li>
  <li class="stepper-item">Update profile</li>
  <li class="stepper-item">Finish</li>
</ol>

Full width

<%= render Railsboot::StepperComponent.new(alignment: "horizontal", class: "w-100") do |stepper| %>
  <% stepper.with_item(active: true).with_content("Create account") %>
  <% stepper.with_item(active: true).with_content("Confirm email") %>
  <% stepper.with_item.with_content("Update profile") %>
  <% stepper.with_item.with_content("Finish") %>
<% end %>
<ol class="stepper stepper-horizontal w-100">
  <li class="stepper-item active">Create account</li>
  <li class="stepper-item active">Confirm email</li>
  <li class="stepper-item">Update profile</li>
  <li class="stepper-item">Finish</li>
</ol>

Slots

item Railsboot::StepperComponent::ItemComponent Allows many

An Item represents the step link in the step list. The item slot can be passed a content block, which will be rendered inside.

Name Default Type Description
text String The text of the item
active Boolean Defines if the item is currently active or not
html_attributes {} Hash Any attributes for the used html wrapper tag

Installation

Simply download this component with all its related files and assets. Unpackage the downloaded ZIP-file, copy all relevant files into your app and adapt the things you need. The ZIP-folder contains:

  • A parent component class (app/components/railsboot/component.rb) of which all components inherit from.
  • A base component class (app/components/railsboot/base_component.rb) which is used for rendering internally.
  • The desired component itself (app/components/railsboot/stepper_component.rb).
  • A view template (app/components/railsboot/stepper_component.html.erb) for the component unless it's rendered inline.
  • Any other dependent components such as Slots (just if the component needs those)
  • Any dependent assets (JS-Files, CSS-Files) (just if the component needs those)
  • A test file for the components (test/components/railsboot/stepper_component_test.rb) including potential slot or dependency tests.

For more information please refer to the installation section.

Download

Download the component and its related files (e.g. templates, assets, slots etc.), unpackage the zip file and adapt the things you need.

Get access You need to purchase a professional license to download this component.