useInput API
Demos
For examples and details on the usage of this React hook, visit the demo pages:
Import
import { useInput } from '@mui/base/InputUnstyled';
Parameters
Name | Type | Default | Description |
---|---|---|---|
defaultValue | unknown | The default value. Use when the component is not controlled. | |
disabled | boolean | If true , the component is disabled.
The prop defaults to the value (false ) inherited from the parent FormControl component. | |
error | boolean | If true , the input will indicate an error by setting the aria-invalid attribute.
The prop defaults to the value (false ) inherited from the parent FormControl component. | |
inputRef | React.Ref<HTMLInputElement> | ||
onBlur | React.FocusEventHandler | ||
onChange | React.ChangeEventHandler<HTMLInputElement> | ||
onClick | React.MouseEventHandler | ||
onFocus | React.FocusEventHandler | ||
required | boolean | If true , the input element is required.
The prop defaults to the value (false ) inherited from the parent FormControl component. | |
value | unknown |
Return value
Name | Type | Default | Description |
---|