Class: NitroKit::ButtonGroup
- Defined in:
- app/components/nitro_kit/button_group.rb
Instance Attribute Summary
Attributes inherited from Component
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ButtonGroup
constructor
A new instance of ButtonGroup.
- #view_template ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(**attrs) ⇒ ButtonGroup
Returns a new instance of ButtonGroup.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/components/nitro_kit/button_group.rb', line 5 def initialize(**attrs) super( attrs, class: [ "flex -space-x-px isolate", # Remove rounded corners from middle buttons "[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child:not(:last-child)]:rounded-r-none [&>*:last-child:not(:first-child)]:rounded-l-none", # Put focused button on top "[&>*]:focus:z-10" ] ) end |
Instance Method Details
#view_template ⇒ Object
18 19 20 21 22 |
# File 'app/components/nitro_kit/button_group.rb', line 18 def view_template div(**attrs) do yield end end |