Forms
Form styles with accessible labels, inputs, and validation states.
Example form
Checkbox inputs
Switch inputs
Radio inputs
Specialised input types
All native HTML5 input types use the same l-ui-form__field class. Date and datetime inputs use the browser's calendar picker, which follows the current light or dark theme.
Action buttons
Use l-ui-form__actions to wrap submit and other action buttons. Buttons are right-aligned on desktop and full-width on mobile.
CSS classes
| Class | Description |
|---|---|
l-ui-form |
Form container |
l-ui-form__group |
Field group with label and input |
l-ui-form__group--large-gap |
Modifier for larger top margin (combine with l-ui-form__group) |
l-ui-form__actions |
Right-aligned action buttons (full-width on mobile) |
l-ui-label |
Form label |
l-ui-form__field |
Text input or textarea |
l-ui-select-container |
Wrapper for select (adds caret icon) |
l-ui-select |
Select dropdown |
l-ui-form__hint |
Help text below input |
l-ui-form__required |
Required field indicator (*) |
l-ui-form__errors |
Validation errors container |
l-ui-form__errors-list |
List of error messages |
l-ui-switch |
Switch wrapper label |
l-ui-switch__input |
Hidden checkbox input (sr-only) |
l-ui-switch__track |
Visible toggle track and thumb |