You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating forms, fields usually need some defaults to be accessible:
A single field must be labelled, usually by a label element (using a for/id pair, except on custom elements like CSelect where aria-labelledby should be used)
It can happen that fields have additional information than just a label, like the desired format, which also needs to be linked to the field (using aria-describedby)
If a field got errors, those needs to be announced (using aria-describedby)
We often want to change the label/field style when it’s invalid
When a field is required, we want the required attribute on the field itself, but we also want a visual indicator to highlight them, like a * next to the label
For these reasons, it would be great to have a FormGroup component that holds the state for a field:
Generate IDs to automatically link label/infos/errors with the field
Accept and provide to its children props that can impact multiple children, like required and errors.
The text was updated successfully, but these errors were encountered:
When creating forms, fields usually need some defaults to be accessible:
label
element (using a for/id pair, except on custom elements like CSelect where aria-labelledby should be used)required
attribute on the field itself, but we also want a visual indicator to highlight them, like a*
next to the labelFor these reasons, it would be great to have a FormGroup component that holds the state for a field:
required
anderrors
.The text was updated successfully, but these errors were encountered: