Class: Polaris::OptionList::OptionComponent
- Inherits:
-
Component
- Object
- Component
- Polaris::OptionList::OptionComponent
- Defined in:
- app/components/polaris/option_list/option_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ OptionComponent
constructor
A new instance of OptionComponent.
- #system_arguments ⇒ Object
Constructor Details
#initialize(**system_arguments) ⇒ OptionComponent
Returns a new instance of OptionComponent.
2 3 4 |
# File 'app/components/polaris/option_list/option_component.rb', line 2 def initialize(**system_arguments) @system_arguments = system_arguments end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/components/polaris/option_list/option_component.rb', line 17 def call render(Polaris::BaseComponent.new(**system_arguments)) do tag.label(class: "Polaris-OptionList-Option__Label") do content end end end |
#system_arguments ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/components/polaris/option_list/option_component.rb', line 6 def system_arguments @system_arguments.tap do |opts| opts[:tag] = "li" opts[:tabindex] = "-1" opts[:classes] = class_names( @system_arguments[:classes], "Polaris-OptionList-Option" ) end end |