Class: Shadcn::RadioGroupComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::RadioGroupComponent
- Defined in:
- app/components/shadcn/radio_group_component.rb
Overview
Radio Group component for selecting one option from a set Uses native elements styled with CSS Works without JavaScript for progressive enhancement
Constant Summary collapse
- BASE_CLASSES =
"grid gap-3"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
-
#initialize(name:, value: nil, items: [], disabled: false, required: false, orientation: :vertical, **options) ⇒ RadioGroupComponent
constructor
A new instance of RadioGroupComponent.
Methods inherited from BaseComponent
Methods included from Shadcn::Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(name:, value: nil, items: [], disabled: false, required: false, orientation: :vertical, **options) ⇒ RadioGroupComponent
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/components/shadcn/radio_group_component.rb', line 55 def initialize( name:, value: nil, items: [], disabled: false, required: false, orientation: :vertical, ** ) super(**) @name = name @value = value @items_data = items @disabled = disabled @required = required @orientation = orientation end |