FilledInput API
API reference docs for the React FilledInput component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import FilledInput from '@mui/material/FilledInput';
// or
import { FilledInput } from '@mui/material';
Props of the InputBase 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 | |
classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
color | 'primary' | 'secondary' | string | The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide. The prop defaults to the value ( | |
components | { Input?: elementType, Root?: elementType } | {} | The components used for each slot inside. |
componentsProps | { input?: object, root?: object } | {} | The extra props for the slot components. You can override the existing props or add new ones. |
defaultValue | any | The default value. Use when the component is not controlled. | |
disabled | bool | If | |
disableUnderline | bool | If | |
endAdornment | node | End | |
error | bool | If | |
fullWidth | bool | false | If |
id | string | The id of the | |
inputComponent | elementType | 'input' | The component used for the |
inputProps | object | {} | Attributes applied to the |
inputRef | ref | Pass a ref to the | |
margin | 'dense' | 'none' | If | |
maxRows | number | string | Maximum number of rows to display when multiline option is set to true. | |
minRows | number | string | Minimum number of rows to display when multiline option is set to true. | |
multiline | bool | false | If |
name | string | Name attribute of the | |
onChange | func | Callback fired when the value is changed. Signature: function(event: React.ChangeEvent
| |
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 | string | Number of rows to display when multiline option is set to true. | |
slotProps | { input?: object, root?: object } | {} | The extra props for the slot components. You can override the existing props or add new ones. |
slots | { input?: elementType, root?: elementType } | {} | The components used for each slot inside. |
startAdornment | node | Start | |
sx | Array<func | object | bool> | func | object | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. | |
type | string | 'text' | Type of the |
value | any | The value of the |
ref
is forwarded to the root element.Inheritance
While not explicitly documented above, the props of the InputBase component are also available in FilledInput. You can take advantage of this to target nested components.
Theme default props
You can use MuiFilledInput
to change the default props of this component with the theme.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Class name | Rule name | Description |
---|---|---|
.Mui-disabled | State class applied to the root element if disabled={true} . | |
.Mui-error | State class applied to the root element if error={true} . | |
.Mui-focused | State class applied to the root element if the component is focused. | |
.MuiFilledInput-adornedEnd | adornedEnd | Styles applied to the root element if endAdornment is provided. |
.MuiFilledInput-adornedStart | adornedStart | Styles applied to the root element if startAdornment is provided. |
.MuiFilledInput-colorSecondary | colorSecondary | Styles applied to the root element if color secondary. |
.MuiFilledInput-input | input | Styles applied to the input element. |
.MuiFilledInput-inputAdornedEnd | inputAdornedEnd | Styles applied to the input element if endAdornment is provided. |
.MuiFilledInput-inputAdornedStart | inputAdornedStart | Styles applied to the input element if startAdornment is provided. |
.MuiFilledInput-inputHiddenLabel | inputHiddenLabel | Styles applied to the input if in . |
.MuiFilledInput-inputMultiline | inputMultiline | Styles applied to the input element if multiline={true} . |
.MuiFilledInput-inputSizeSmall | inputSizeSmall | Styles applied to the input element if size="small" . |
.MuiFilledInput-inputTypeSearch | inputTypeSearch | Styles applied to the input element if type="search" . |
.MuiFilledInput-multiline | multiline | Styles applied to the root element if multiline={true} . |
.MuiFilledInput-root | root | Styles applied to the root element. |
.MuiFilledInput-sizeSmall | sizeSmall | Styles applied to the input element if size="small" . |
.MuiFilledInput-underline | underline | Styles applied to the root element unless disableUnderline={true} . |
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
styleOverrides
property in a custom theme.