Class: PhlexKit::FieldGroup

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/field/field_group.rb

Overview

Column of Fields with the canonical rhythm, ported from shadcn/ui's FieldGroup. Also the CONTAINER for responsive fields — a Field with orientation: :responsive goes horizontal when this group is ≥28rem wide. See field.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ FieldGroup

Returns a new instance of FieldGroup.



7
# File 'app/components/phlex_kit/field/field_group.rb', line 7

def initialize(**attrs) = (@attrs = attrs)

Instance Method Details

#view_templateObject



8
9
10
# File 'app/components/phlex_kit/field/field_group.rb', line 8

def view_template(&)
  div(**mix({ class: "pk-field-group", data: { slot: "field-group" } }, @attrs), &)
end