Form Group
Form groups are the easiest way to add structure and spacing to form elements.
Example
The <i-form-group>
component is a wrapper that provides proper grouping of labels, input, help text, and form validation messaging. By default, form groups add spacing between them.
Disabled State
Setting a form group as disabled
will cause all of its child form components to be disabled.
Sizes
You’re able to use the size
modifier to control the size of the form components inside your <i-form-group>
, using one of the available sizes: sm
, md
, and lg
. The default size is set to md
.
All of the components inside the <i-form-group>
will inherit the parent form group’s size.
Form Group Nesting
You can nest form groups in order to control the disabled
, readonly
and size
properties of multiple form components at once. All the child inputs of the parent form group will inherit the property.
Configuration
Props
Use props to modify the component’s design and behavior.
- Property
color
Type'light' | 'dark'
Default'light'
Description The color variant of the form group - Property
disabled
TypeBoolean
Defaultfalse
Description The disabled state of the form group - Property
inline
TypeBoolean
Defaultfalse
Description Display the form group as inline - Property
name
TypeString
Default''
Description The identifier of the form group - Property
readonly
TypeBoolean
Defaultfalse
Description The readonly state of the form group - Property
required
TypeBoolean
Defaultfalse
Description The required state of the form group - Property
size
Type'sm' | 'md' | 'lg'
Default'md'
Description The size variant of the form group
Slots
Use slots to insert custom content into well-defined component locations.
- Property
default
Description Slot for default form group content
CSS Variables
Read more about configuring Inkline’s Design System variables to update the look and feel of the component.
- Property
----margin-top
Valuevar(--margin-top)
Description The margin top of the form error component