Class: UI::ButtonGroup
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::ButtonGroup
- Includes:
- ButtonGroupBehavior
- Defined in:
- app/components/ui/button_group.rb
Overview
ButtonGroup - Phlex 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
-
#initialize(orientation: :horizontal, classes: "", **attributes) ⇒ ButtonGroup
constructor
A new instance of ButtonGroup.
- #view_template(&block) ⇒ Object
Methods included from ButtonGroupBehavior
#button_group_classes, #button_group_html_attributes
Constructor Details
#initialize(orientation: :horizontal, classes: "", **attributes) ⇒ ButtonGroup
Returns a new instance of ButtonGroup.
39 40 41 42 43 |
# File 'app/components/ui/button_group.rb', line 39 def initialize(orientation: :horizontal, classes: "", **attributes) @orientation = orientation @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
45 46 47 |
# File 'app/components/ui/button_group.rb', line 45 def view_template(&block) div(**.deep_merge(@attributes), &block) end |