Class: Fluxbit::BottomNavigationComponent::ButtonGroup::Button
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Fluxbit::BottomNavigationComponent::ButtonGroup::Button
- Includes:
- Config::BottomNavigationComponent
- Defined in:
- app/components/fluxbit/bottom_navigation_component.rb
Overview
Button component for button group
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**props, &block) ⇒ Button
constructor
Initializes the button component.
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) ⇒ Button
Initializes the button component.
412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'app/components/fluxbit/bottom_navigation_component.rb', line 412 def initialize(**props, &block) super(**props, &block) @props = props @parent_config = @props.delete(:parent_config) @href = @props.delete(:href) || "#" @active = (@props.delete(:active), default: false) add(class: styles[:button_group][:button], to: @props, first_element: true) add(class: styles[:button_group][:button_active], to: @props) if @active add(class: styles[:button_group][:button_inactive], to: @props) unless @active @props[:class] = remove_class(@props.delete(:remove_class) || "", @props[:class]) end |
Instance Method Details
#call ⇒ Object
427 428 429 430 431 432 433 434 |
# File 'app/components/fluxbit/bottom_navigation_component.rb', line 427 def call @props[:data] ||= {} @props[:data][:href] = @href tag.(type: "button", **@props) do content end end |