Class: UI::ButtonGroupComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ButtonGroupComponent
- Includes:
- ButtonGroupBehavior
- Defined in:
- app/view_components/ui/button_group_component.rb
Overview
ButtonGroupComponent - ViewComponent implementation
A container that groups related buttons together with consistent styling. Uses ButtonGroupBehavior module for shared styling logic.
Based on shadcn/ui ButtonGroup: ui.shadcn.com/docs/components/button-group
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(orientation: :horizontal, classes: "", **attributes) ⇒ ButtonGroupComponent
constructor
A new instance of ButtonGroupComponent.
Methods included from ButtonGroupBehavior
#button_group_classes, #button_group_html_attributes
Constructor Details
#initialize(orientation: :horizontal, classes: "", **attributes) ⇒ ButtonGroupComponent
Returns a new instance of ButtonGroupComponent.
27 28 29 30 31 |
# File 'app/view_components/ui/button_group_component.rb', line 27 def initialize(orientation: :horizontal, classes: "", **attributes) @orientation = orientation @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
33 34 35 36 37 |
# File 'app/view_components/ui/button_group_component.rb', line 33 def call tag.div(**.deep_merge(@attributes)) do content end end |