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:
<ExternalProps extends Record<string, any> = {}>(externalProps?: ExternalProps) => UseInputInputSlotProps<ExternalProps>Resolver for the root slot's props.
Type:
<ExternalProps extends Record<string, any> = {}>(externalProps?: ExternalProps) => UseInputRootSlotProps<ExternalProps>