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

NameTypeDefaultDescription
isInvalidbooleanIf true, this prop is passed to its children.
isRequiredbooleanIf true, this prop is passed to its children.
isDisabledbooleanIf true, this prop is passed to its children.
isReadOnlybooleanIf true, this prop is passed to its children.