Class: PhlexKit::RadioGroup

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/radio_group/radio_group.rb

Overview

Radio list wrapper, ported from shadcn/ui's RadioGroup: a role=radiogroup grid of (RadioButton + Label) rows sharing a name. The kit's RadioButton is the item. .pk-radio-group (radio_group.css).

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ RadioGroup

Returns a new instance of RadioGroup.



6
7
8
# File 'app/components/phlex_kit/radio_group/radio_group.rb', line 6

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



10
11
12
# File 'app/components/phlex_kit/radio_group/radio_group.rb', line 10

def view_template(&)
  div(**mix({ class: "pk-radio-group", role: "radiogroup" }, @attrs), &)
end