Input
The Input component provides users with a field to enter and edit text.
Input API
Import
import { Input } from '@mui/base/Input';
// or
import { Input } from '@mui/base';
Props of the native component are also available.
Name | Type | Default | Description |
---|---|---|---|
autoComplete | string | - | This prop helps users to fill forms faster, especially on mobile devices. The name can be confusing, as it's more like an autofill. You can learn more about it following the specification. |
autoFocus | bool | - | If |
className | string | - | Class name applied to the root element. |
defaultValue | any | - | The default value. Use when the component is not controlled. |
disabled | bool | - | If |
endAdornment | node | - | Trailing adornment for this input. |
error | bool | - | If |
id | string | - | The id of the |
maxRows | number | - | Maximum number of rows to display when multiline option is set to true. |
minRows | number | - | Minimum number of rows to display when multiline option is set to true. |
multiline | bool | false | If |
name | string | - | Name attribute of the |
placeholder | string | - | The short hint displayed in the |
readOnly | bool | - | It prevents the user from changing the value of the field (not from interacting with the field). |
required | bool | - | If |
rows | number | - | Number of rows to display when multiline option is set to true. |
slotProps | { input?: func | object, root?: func | object } | {} | The props used for each slot inside the Input. |
slots | { input?: elementType, root?: elementType, textarea?: elementType } | {} | The components used for each slot inside the InputBase. Either a string to use a HTML element or a component. See Slots API below for more details. |
startAdornment | node | - | Leading adornment for this input. |
type | 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | 'text' | Type of the |
value | any | - | The value of the |
ref
is forwarded to the root element.