Class: PhlexKit::ButtonGroup

Inherits:
BaseComponent show all
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

Methods inherited from BaseComponent

#on

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_templateObject



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