Skip to content

InputBase API

API reference docs for the React InputBase component. Learn about the props, CSS, and other APIs of this exported module.

Demos

For examples and details on the usage of this React component, visit the component demo pages:

Import

import InputBase from '@mui/material/InputBase';
// or
import { InputBase } from '@mui/material';
Learn about the difference by reading this guide on minimizing bundle size.

InputBase contains as few styles as possible. It aims to be a simple building block for creating an input. It contains a load of style reset and some state logic.

Props

Props of the native component are also available.

autoComplete

autoFocus

classes

color

components

componentsProps

defaultValue

disabled

disableInjectingGlobalStyles

endAdornment

error

fullWidth

id

inputComponent

inputProps

inputRef

margin

maxRows

minRows

multiline

name

onBlur

onChange

onInvalid

placeholder

readOnly

required

rows

size

slotProps

slots

startAdornment

sx

type

value

The ref is forwarded to the root element.

Theme default props

You can use MuiInputBase to change the default props of this component with the theme.


CSS

The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.

.MuiInputBase-root

.MuiInputBase-formControl

.Mui-focusedSTATE

.Mui-disabledSTATE

.MuiInputBase-adornedStart

.MuiInputBase-adornedEnd

.Mui-errorSTATE

.MuiInputBase-sizeSmall

.MuiInputBase-multiline

.MuiInputBase-colorSecondary

.MuiInputBase-fullWidth

.MuiInputBase-hiddenLabel

.Mui-readOnlySTATE

.MuiInputBase-input

.MuiInputBase-inputSizeSmall

.MuiInputBase-inputMultiline

.MuiInputBase-inputTypeSearch

.MuiInputBase-inputAdornedStart

.MuiInputBase-inputAdornedEnd

.MuiInputBase-inputHiddenLabel


You can override the style of the component using one of these customization options: