Class: UI::ButtonGroupTextComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ButtonGroupTextComponent
- Includes:
- ButtonGroupTextBehavior
- Defined in:
- app/view_components/ui/button_group_text_component.rb
Overview
TextComponent - ViewComponent implementation
Displays text within a button group. Uses ButtonGroupTextBehavior module for shared styling logic.
Based on shadcn/ui ButtonGroup: ui.shadcn.com/docs/components/button-group
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ ButtonGroupTextComponent
constructor
A new instance of ButtonGroupTextComponent.
Methods included from ButtonGroupTextBehavior
#text_classes, #text_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ ButtonGroupTextComponent
Returns a new instance of ButtonGroupTextComponent.
20 21 22 23 |
# File 'app/view_components/ui/button_group_text_component.rb', line 20 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 |
# File 'app/view_components/ui/button_group_text_component.rb', line 25 def call tag.div(**text_html_attributes.deep_merge(@attributes)) do content end end |