FormControl
The form control provides context such as `isInvalid`, `isDisabled`, ìsReadOnly` and `isRequired` to form elements.
Import
Importimport { FormControl } from '@backyard-ui/core';Usage
UsageThe htmlFor from Label is set automatically for children’s input.
Helper text
Helper textSometimes it’s necessary to tell users more details about the form section, so use FormErrorMessage component for that.
Error message
Error messageUse the isInvalid prop to show up the FormErrorMessage component.
Required field
Required fieldUse the isRequired prop to make a field required.
Readonly field
Readonly fieldUse the isReadOnly prop to make a field read-only.
Select field
Select fieldUsage with Select.
API Reference
API ReferenceRoot
Root- labelDescription The label is used to describe the form element purpose.Type
string - idDescription The custom `id` to use for the form control. This is passed directly to the form element (e.g, Input). If not defined, a randomly generated id is used.Type
string - isDisabledDescription Set the form element to disabledType
boolean - isInvalidDescription Set the form element `aria-invalid` to `true`Type
boolean - isReadOnlyDescription Set the form element to readonlyType
boolean - isRequiredDescription Set the form element `aria-required` to `true`Type
boolean 
Helper text
Helper text- children requiredDescription The label childrenType
ReactNode 
Error Message
Error Message- children requiredDescription The span childrenType
ReactNode