Class: NitroKit::FieldGroup

Inherits:
Component
  • Object
show all
Defined in:
app/components/nitro_kit/field_group.rb

Constant Summary

Constants inherited from Component

Component::ADDITIVE_DATA_ATTRIBUTES, Component::COMPONENT_OWNED_DATA_ATTRIBUTES, Component::FORBIDDEN_ATTRIBUTES, Component::RESERVED_DATA_ATTRIBUTES

Instance Method Summary collapse

Constructor Details

#initialize(html: {}, aria: {}, data: {}, desperately_need_a_class: nil) ⇒ FieldGroup

Returns a new instance of FieldGroup.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/components/nitro_kit/field_group.rb', line 5

def initialize(
  html: {},
  aria: {},
  data: {},
  desperately_need_a_class: nil
)
  super(
    component: :field_group,
    html:,
    aria:,
    data:,
    desperately_need_a_class:
  )
end

Instance Method Details

#view_template(&block) ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
23
24
# File 'app/components/nitro_kit/field_group.rb', line 20

def view_template(&block)
  raise ArgumentError, "field group requires a block" unless block

  div(**root_attributes, &block)
end