Class: PhlexKit::ButtonGroup
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ButtonGroup
- Defined in:
- app/components/phlex_kit/button_group/button_group.rb
Overview
Joined row of buttons, ported from shadcn/ui's ButtonGroup: children lose
their inner corners/double borders and read as one segmented control.
.pk-button-group (button_group.css).
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ButtonGroup
constructor
A new instance of ButtonGroup.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ButtonGroup
Returns a new instance of ButtonGroup.
6 7 8 |
# File 'app/components/phlex_kit/button_group/button_group.rb', line 6 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/button_group/button_group.rb', line 10 def view_template(&) div(**mix({ class: "pk-button-group", role: "group" }, @attrs), &) end |