Components
Form Control
FormControl provides context such as isInvalid, isDisabled, and isRequired to form elements. This context is used
by the following components:
It follows the WAI specifications for forms.
Import
import { FormControl, FormLabel, FormErrorMessage, FormHelperText } from '@outfitio/outkit';
Usage
Sample usage for a radio or checkbox group
Making a field required
By passing the isRequired props, the Input field has aria-required set to true, and the FormLabel will show a
red asterisks.
Select Example
Props
| Name | Type | Default | Description |
|---|---|---|---|
isInvalid | boolean | If true, this prop is passed to its children. | |
isRequired | boolean | If true, this prop is passed to its children. | |
isDisabled | boolean | If true, this prop is passed to its children. | |
isReadOnly | boolean | If true, this prop is passed to its children. |