Class: Fluxbit::BottomNavigationComponent::ButtonGroup

Inherits:
Component
  • Object
show all
Includes:
Config::BottomNavigationComponent
Defined in:
app/components/fluxbit/bottom_navigation_component.rb

Overview

ButtonGroup component for bottom navigation

Defined Under Namespace

Classes: Button

Constant Summary

Constants inherited from Component

Component::ComponentObj

Instance Method Summary collapse

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, &block) ⇒ ButtonGroup

Initializes the button group component.

Parameters:

  • **props (Hash)

    The properties to customize the button group.

  • props (Hash)

    a customizable set of options

Options Hash (**props):

  • :columns (Integer) — default: 3

    Number of columns for button grid (2-5).

  • **props (Hash)

    Remaining options declared as HTML attributes.



372
373
374
375
376
377
# File 'app/components/fluxbit/bottom_navigation_component.rb', line 372

def initialize(**props, &block)
  super(**props, &block)
  @props = props
  @parent_config = @props.delete(:parent_config)
  @columns = @props.delete(:columns) || 3
end

Instance Method Details

#callObject



379
380
381
382
383
384
385
386
387
# File 'app/components/fluxbit/bottom_navigation_component.rb', line 379

def call
  buttons # Ensure buttons are rendered

  tag.div(class: styles[:button_group][:container], role: "group") do
    tag.div(class: button_group_grid_classes) do
      safe_join(buttons)
    end
  end
end