Class: Fluxbit::FlexComponent
- Includes:
- Config::FlexComponent
- Defined in:
- app/components/fluxbit/flex_component.rb
Overview
The ‘Fluxbit::FlexComponent` is a component for rendering customizable flex containers. It extends `Fluxbit::Component` and provides options for configuring the flex container’s appearance and behavior. You can control the flex direction, alignment, wrapping, gap, and other attributes. This component is useful for creating responsive layouts and aligning content dynamically.
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**props) ⇒ FlexComponent
constructor
Initializes the flex component with various customization options.
Methods inherited from Component
#add, #add_popover_or_tooltip, #anyicon, #element_name, #fx_id, #options, #random_id, #remove_class, #render_popover_or_tooltip, #target
Constructor Details
#initialize(**props) ⇒ FlexComponent
Initializes the flex component with various customization options.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/components/fluxbit/flex_component.rb', line 21 def initialize(**props) @props = props declare_classes(@props) %i[vertical reverse justify_content align_items wrap wrap_reverse gap].each do |key| @props.delete(key) end styles[:resolutions].each do |resolution| if @props.key?(resolution) declare_classes(@props.delete(resolution), resolution) end end end |
Instance Method Details
#call ⇒ Object
36 37 38 |
# File 'app/components/fluxbit/flex_component.rb', line 36 def call content_tag :div, content, @props end |