design-system
design-system copied to clipboard
FormField has limitation to render children
FormField
has strict requirement of children, which creates limitation to render children w. composition such as the snippet below for a11y.
It'd be nice to improve the support of support to offer a more robust composition w. possibilities.
<FormField>
<SrOnly>
<Label>Voice Over</Label>
</SrOnly>
<Icon>
<Select>
<option>a</option>
</Select>
<FormField>

Discussion notes
Before starting work, we should define a list of allowed child components and a cap on the number of children. We could cap it at 5 children if SrOnly
is used, and 4 otherwise.
Proposed allowed children:
- Label
- SrOnly
- Icon
- Input
- Select
- Autocomplete