Form Group
A versatile wrapper for various form components such as `Input`, `Textarea`, `Select`, and more. It offers a comprehensive set of features, including label, description, hint, message, status, and others.
Examples
Basic
Prop | Default | Type | Description |
---|---|---|---|
label | - | string | Adds a label to the form group. |
id | - | string | Sets the form group's id. |
for | - | string | Sets the label's for attribute. |
Clicking the label focuses the input. We automatically add for
to the label and id
to the input. Override this by defining for
and id
manually.
Read more in Label component
Required
Prop | Default | Type | Description |
---|---|---|---|
required | false | boolean | Adds * to the label. |
Description
Prop | Default | Type | Description |
---|---|---|---|
description | - | string | Adds a description to the form group. |
We'll never share your email with anyone else.
Hint
Prop | Default | Type | Description |
---|---|---|---|
hint | - | string | Adds a hint to the form group. |
Optional
Message
Prop | Default | Type | Description |
---|---|---|---|
message | - | string | Sets the form group's message. |
We'll never share your email with anyone else.
Status
Prop | Default | Type | Description |
---|---|---|---|
status | - | info ,success , warning , error , undefined | Sets the form group's status. |
Notice that when you change the status
prop, the message
prop and the child component status
prop are automatically updated.
Your username is available.
This information will be visible to other users.
Your email is invalid
Your password is weak.
Counter
Prop | Default | Type | Description |
---|---|---|---|
counter | - | object | Enables the form group's counter. |
Counter | Default | Type | Description |
---|---|---|---|
value | - | string | Sets the counter value. |
max | - | number | Sets the maximum counter number. |
Username has no length limit
0
0/10
Slots
Name | Props | Description |
---|---|---|
default | - | The default slot of the form group, refer Basic section. |
top | - | The top section of the form group. |
bottom | - | The bottom section of the form group. |
label | - | The label slot of the form group. |
description | - | The description slot of the form group. |
hint | - | The hint slot of the form group. |
message | - | The message slot of the form group. |
counter | - | The counter slot of the form group. |
Props
types/form-group.ts
Presets
shortcuts/form-group.ts