Unstyled Form Control
The Unstyled Form Control component is a utility that lets you associate a form input with auxiliary components, such as labels, error indicators, or helper text.
useFormControlUnstyledContext API
Import
import useFormControlUnstyledContext from '@mui/base/FormControlUnstyled';
// or
import { useFormControlUnstyledContext } from '@mui/base';Parameters
This hook does not accept any input parameters.Return value
| Name | Type | Default | Description |
|---|---|---|---|
| filled | boolean | If true, the form element has some value. | |
| focused | boolean | If true, the form element is focused and not disabled. | |
| onBlur | () => void | Callback fired when the form element has lost focus. | |
| onFocus | () => void | Callback fired when the form element receives focus. | |
| disabled? | boolean | false | If true, the label, input and helper text should be displayed in a disabled state. |
| error? | boolean | false | If true, the label is displayed in an error state. |
| onChange? | React.ChangeEventHandler<NativeFormControlElement> | Callback fired when the form element's value is modified. | |
| required? | boolean | false | If true, the label will indicate that the input is required. |
| value? | unknown | The value of the form element. |