Class: Fluxbit::StepperComponent
- Includes:
- Config::StepperComponent
- Defined in:
- app/components/fluxbit/stepper_component.rb
Overview
The ‘Fluxbit::StepperComponent` is a customizable stepper component that extends `Fluxbit::Component`. It provides a visual representation of a multi-step process, supporting both horizontal and vertical orientations with various styling options including different colors and states.
Defined Under Namespace
Classes: Step
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**props) ⇒ Fluxbit::StepperComponent
constructor
Initializes the stepper component with the given properties.
Methods inherited from Component
#add, #add_popover_or_tooltip, #anyicon, #element_name, #fx_id, #icon, #options, #popover?, #random_id, #remove_class, #remove_class_from_props, #render_popover_or_tooltip, #target, #tooltip?
Methods included from IconHelpers
#chevron_double_left, #chevron_double_right, #chevron_down, #chevron_left, #chevron_right, #chevron_up, #close_icon, #ellipsis_horizontal, #eye_icon, #eye_slash_icon, #plus_icon
Constructor Details
#initialize(**props) ⇒ Fluxbit::StepperComponent
Initializes the stepper component with the given properties.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/components/fluxbit/stepper_component.rb', line 36 def initialize(**props) super @props = props @orientation = @props.delete(:orientation), collection: styles[:base].keys, default: @@orientation @variant = @props.delete(:variant), collection: styles[:list].keys, default: @@variant @color = @props.delete(:color), collection: styles[:step][:default][:active].keys, default: @@color add class: styles[:base][@orientation], to: @props, first_element: true remove_class_from_props(@props) end |
Instance Method Details
#call ⇒ Object
48 49 50 51 52 53 54 |
# File 'app/components/fluxbit/stepper_component.rb', line 48 def call tag.div(**@props) do tag.ol(class: styles[:list][@variant][@orientation]) do safe_join(steps.map.with_index { |step, index| render_step(step, index) }) end end end |