Class: PhlexyUI::Checkbox

Inherits:
Base
  • Object
show all
Defined in:
lib/phlexy_ui/checkbox.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PhlexyUI::Base

Instance Method Details

#view_templateObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/phlexy_ui/checkbox.rb', line 5

def view_template(&)
  attributes = generate_attributes(base_modifiers, options, ATTRIBUTES_MAP)

  generate_classes!(
    component_html_class: :checkbox,
    modifiers_map: modifiers,
    base_modifiers:,
    options:
  ).then do |classes|
    input(
      type: :checkbox,
      class: classes,
      **options.except(*ATTRIBUTES_MAP.keys),
      **attributes,
      &
    )
  end
end