Unstyled Input
The Unstyled Input component provides users with a field to enter and edit text.
InputUnstyled API
Import
import InputUnstyled from '@mui/base/InputUnstyled';
// or
import { InputUnstyled } from '@mui/base';Props
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  true, theinputelement is focused during the first mount. | |
| className | string | Class name applied to the root element. | |
| component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
| defaultValue | any | The default value. Use when the component is not controlled. | |
| disabled | bool | If  true, the component is disabled. The prop defaults to the value (false) inherited from the parent FormControl component. | |
| endAdornment | node | Trailing adornment for this input. | |
| error | bool | If  true, theinputwill indicate an error by setting thearia-invalidattribute on the input and theMui-errorclass on the root element. The prop defaults to the value (false) inherited from the parent FormControl component. | |
| id | string | The id of the  inputelement. | |
| 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  true, atextareaelement is rendered. | 
| name | string | Name attribute of the  inputelement. | |
| placeholder | string | The short hint displayed in the  inputbefore the user enters a value. | |
| readOnly | bool | It prevents the user from changing the value of the field (not from interacting with the field). | |
| required | bool | If  true, theinputelement is required. The prop defaults to the value (false) inherited from the parent FormControl component. | |
| 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  inputelement. It should be a valid HTML5 input type. | 
| value | any | The value of the  inputelement, required for a controlled component. | 
The
ref is forwarded to the root element.Slots
To learn how to customize the slot, check out the Overriding component structure guide.
| Name | Default class | Default HTML tag | Description | 
|---|---|---|---|
| root | .MuiInput-root | 'div' | The component that renders the root. | 
| input | .MuiInput-input | 'input' | The component that renders the input. | 
| textarea | 'textarea' | The component that renders the textarea. | 
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's styleOverridesproperty in a custom theme.
CSS classes
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.
| Global class | Description | 
|---|---|
| .Mui-disabled STATE | State class applied to the root element if disabled={true}. | 
| .Mui-error STATE | State class applied to the root element if error={true}. | 
| .Mui-focused STATE | State class applied to the root element if the component is focused. | 
| .MuiInput-adornedEnd | Class name applied to the root element if endAdornmentis provided. | 
| .MuiInput-adornedStart | Class name applied to the root element if startAdornmentis provided. | 
| .MuiInput-formControl | Class name applied to the root element if the component is a descendant of FormControl. | 
| .MuiInput-inputMultiline | Class name applied to the input element if multiline={true}. | 
| .MuiInput-inputTypeSearch | Class name applied to the input element if type="search". | 
| .MuiInput-multiline | Class name applied to the root element if multiline={true}. |