/

FormControl


The form control is a wrapper for all other components in Forms section. It adds an accessible label and allows to handle error message.

Adding label

import { FormControl, Input } from 'insites-ui'

<FormControl>
    <FormControl.Label htmlFor="displayName">Display name</FormControl.Label>
    <Input id="displayName" placeholder="Bryan Fury" />
</FormControl>

Handling errors

Given name is too short.
import { FormControl, Input } from 'insites-ui'

<FormControl>
    <FormControl.Label htmlFor="displayName">Display name</FormControl.Label>
    <Input id="displayName" placeholder="Bryan Fury" hasError />
    <FormControl.Error>Given name is too short.</FormControl.Error>
</FormControl>

Form example

Edit on GitHub