Class: DaisyUI::AccordionItem
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- DaisyUI::AccordionItem
- Defined in:
- app/components/daisy_ui/data_display/accordion_item.rb
Overview
Renders a single accordion item within an AccordionComponent.
Constant Summary collapse
- INDICATORS =
%i[arrow plus].freeze
- INPUT_TYPES =
%i[radio checkbox].freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title:, name:, text: nil, checked: false, indicator: nil, input_type: :checkbox, join: false, bg_color: nil, text_color: nil, border_color: nil, padding: nil, **system_arguments) ⇒ AccordionItem
constructor
A new instance of AccordionItem.
Constructor Details
#initialize(title:, name:, text: nil, checked: false, indicator: nil, input_type: :checkbox, join: false, bg_color: nil, text_color: nil, border_color: nil, padding: nil, **system_arguments) ⇒ AccordionItem
Returns a new instance of AccordionItem.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'app/components/daisy_ui/data_display/accordion_item.rb', line 61 def initialize(title:, name:, text: nil, checked: false, indicator: nil, input_type: :checkbox, join: false, bg_color: nil, text_color: nil, border_color: nil, padding: nil, **system_arguments) @title = title @name = name @text = text @checked = checked @indicator = indicator @input_type = input_type @join = join @bg_color = bg_color @text_color = text_color @border_color = border_color @padding = padding super(**system_arguments) end |
Instance Method Details
#call ⇒ Object
78 79 80 81 82 |
# File 'app/components/daisy_ui/data_display/accordion_item.rb', line 78 def call tag.div(**html_attributes) do safe_join([render_input, render_title, render_content].compact) end end |