Color Schemes for FormControl
are not implemented in the default theme. You can extend the theme to implement them.
Form Control
Form Control provides context such as `isInvalid`, `isDisabled`, and `isRequired` to form elements
Props#
colorScheme
colorScheme
string
isDisabled
isDisabled
If true
, the form control will be disabled. This has 2 side effects:
- The FormLabel
will have `data-disabled` attribute
- The form element (e.g, Input) will be disabled
boolean
isInvalid
isInvalid
If true
, the form control will be invalid. This has 2 side effects:
- The FormLabel
and FormErrorIcon
will have `data-invalid` set to true
- The form element (e.g, Input) will have `aria-invalid` set to true
boolean
isReadOnly
isReadOnly
If true
, the form control will be readonly
boolean
isRequired
isRequired
If true
, the form control will be required. This has 2 side effects:
- The FormLabel
will show a required indicator
- The form element (e.g, Input) will have `aria-required` set to true
boolean
label
label
The label text used to inform users as to what information is requested for a text field.
string
size
size
Sizes for FormControl
are not implemented in the default theme. You can extend the theme to implement them.
string
variant
variant
Variants for FormControl
are not implemented in the default theme. You can extend the theme to implement them.
string
Props#
colorScheme
colorScheme
Color Schemes for FormControl
are not implemented in the default theme. You can extend the theme to implement them.
string
isDisabled
isDisabled
If true
, the form control will be disabled. This has 2 side effects:
- The FormLabel
will have `data-disabled` attribute
- The form element (e.g, Input) will be disabled
boolean
isInvalid
isInvalid
If true
, the form control will be invalid. This has 2 side effects:
- The FormLabel
and FormErrorIcon
will have `data-invalid` set to true
- The form element (e.g, Input) will have `aria-invalid` set to true
boolean
isReadOnly
isReadOnly
If true
, the form control will be readonly
boolean
isRequired
isRequired
If true
, the form control will be required. This has 2 side effects:
- The FormLabel
will show a required indicator
- The form element (e.g, Input) will have `aria-required` set to true
boolean
label
label
The label text used to inform users as to what information is requested for a text field.
string
size
size
Sizes for FormControl
are not implemented in the default theme. You can extend the theme to implement them.
string
variant
variant
Variants for FormControl
are not implemented in the default theme. You can extend the theme to implement them.
string