PickersTextField API
API reference docs for the React PickersTextField component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
// or
import { PickersTextField } from '@mui/x-date-pickers';
// or
import { PickersTextField } from '@mui/x-date-pickers-pro';Learn about the difference by reading this guide on minimizing bundle size.
| Name | Type | Default | Description | 
|---|---|---|---|
| areAllSectionsEmpty* | bool | - | Is  | 
| contentEditable* | bool | - | If true, the whole element is editable. Useful when all the sections are selected. | 
| elements* | Array<{ after: object, before: object, container: object, content: object }> | - | The elements to render. Each element contains the prop to edit a section of the value. | 
| color | 'error' | 'info' | 'primary' | 'secondary' | 'success' | 'warning' | 'primary' | The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide. | 
| focused | bool | - | If  | 
| helperText | node | - | The helper text content. | 
| InputProps | object | - | Props applied to the Input element. It will be a  | 
| margin | 'dense' | 'none' | 'normal' | 'none' | If  | 
| required | bool | false | If  | 
| size | 'medium' | 'small' | 'medium' | The size of the component. | 
| 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. | 
| variant | 'filled' | 'outlined' | 'standard' | 'outlined' | The variant to use. | 
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 | 
|---|---|---|
| .MuiPickersTextField-fullWidth | fullWidth | Styles applied to the root element if fullWidth={true}. | 
| .MuiPickersTextField-marginDense | marginDense | Styles applied to the root element if margin="dense". | 
| .MuiPickersTextField-marginNormal | marginNormal | Styles applied to the root element if margin="normal". | 
| .MuiPickersTextField-root | root | Styles applied to the root element. | 
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.