UNPKG

2.07 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableComponent, OverrideProps } from '../OverridableComponent';
4import { Theme } from '..';
5import { InputAdornmentClasses } from './inputAdornmentClasses';
6
7export interface InputAdornmentOwnProps {
8 /**
9 * Override or extend the styles applied to the component.
10 */
11 classes?: Partial<InputAdornmentClasses>;
12 /**
13 * The content of the component, normally an `IconButton` or string.
14 */
15 children?: React.ReactNode;
16 /**
17 * Disable pointer events on the root.
18 * This allows for the content of the adornment to focus the `input` on click.
19 * @default false
20 */
21 disablePointerEvents?: boolean;
22 /**
23 * If children is a string then disable wrapping in a Typography component.
24 * @default false
25 */
26 disableTypography?: boolean;
27 /**
28 * The position this adornment should appear relative to the `Input`.
29 */
30 position: 'start' | 'end';
31 /**
32 * The system prop that allows defining system overrides as well as additional CSS styles.
33 */
34 sx?: SxProps<Theme>;
35 /**
36 * The variant to use.
37 * Note: If you are using the `TextField` component or the `FormControl` component
38 * you do not have to set this manually.
39 */
40 variant?: 'standard' | 'outlined' | 'filled';
41}
42
43export interface InputAdornmentTypeMap<
44 AdditionalProps = {},
45 RootComponent extends React.ElementType = 'div',
46> {
47 props: AdditionalProps & InputAdornmentOwnProps;
48 defaultComponent: RootComponent;
49}
50/**
51 *
52 * Demos:
53 *
54 * - [Text Field](https://mui.com/material-ui/react-text-field/)
55 *
56 * API:
57 *
58 * - [InputAdornment API](https://mui.com/material-ui/api/input-adornment/)
59 */
60declare const InputAdornment: OverridableComponent<InputAdornmentTypeMap>;
61
62export type InputAdornmentProps<
63 RootComponent extends React.ElementType = InputAdornmentTypeMap['defaultComponent'],
64 AdditionalProps = {},
65> = OverrideProps<InputAdornmentTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
66 component?: React.ElementType;
67};
68
69export default InputAdornment;