Skip to contentSkip to content

OTPFieldInput API

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

Demos

Import

import OTPFieldInput from '@mui/material/OTPFieldInput';
// or
import { OTPFieldInput } from '@mui/material';

Learn about the difference by reading this guide on minimizing bundle size.



A single character in an OTPField.

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

CSS class applied to the element, or a function that returns a class based on the component's state.

renderelement
| func

Allows you to replace the component's HTML element with a different tag, or compose it with another component.
Accepts a ReactElement or a function that returns the element to render.

stylefunc
| object

Style applied to the element, or a function that returns a style object based on the component's state.

sxArray<func
| object
| bool>
| func
| object

System styles for this character input.

See the `sx` page for more details.

The component cannot hold a ref.

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.