Input
The Input component provides users with a field to enter and edit text.
useInput API
Import
import useInput from '@mui/base/useInput';
// or
import { useInput } from '@mui/base';Parameters
If true, the component is disabled.
The prop defaults to the value (false) inherited from the parent FormControl component.
Type:
booleanIf 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.
Type:
booleanIf true, the input element is required.
The prop defaults to the value (false) inherited from the parent FormControl component.
Type:
booleanReturn value
Return value from the useFormControlContext hook.
Type:
FormControlState | undefinedResolver for the input slot's props.
Type:
<TOther extends Record<string, any> = {}>(externalProps?: TOther) => UseInputInputSlotProps<TOther>Resolver for the root slot's props.
Type:
<TOther extends Record<string, any> = {}>(externalProps?: TOther) => UseInputRootSlotProps<TOther>