Class: Fluxbit::TimelineComponent
- Includes:
- Config::TimelineComponent
- Defined in:
- app/components/fluxbit/timeline_component.rb
Overview
The ‘Fluxbit::TimelineComponent` is a component for rendering customizable timelines.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**props) ⇒ Fluxbit::TimelineComponent
constructor
Initializes the Timeline component with various customization options.
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::TimelineComponent
Initializes the Timeline component with various customization options.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/components/fluxbit/timeline_component.rb', line 24 def initialize(**props) super @props = props @variant = @props.delete(:variant), collection: styles[:variants].keys, default: @@variant @position = @props.delete(:position), collection: styles[:positions].keys, default: @@position add class: [ styles[:base], styles[:variants][@variant], styles[:positions][@position] ], to: @props remove_class_from_props(@props) end |
Instance Method Details
#call ⇒ Object
40 41 42 43 44 |
# File 'app/components/fluxbit/timeline_component.rb', line 40 def call content_tag(@variant == :stepper ? "ol" : "ul", **@props) do items_with_position.join.html_safe end end |