UNPKG

2.39 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableStringUnion } from '@mui/types';
4import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5import { Theme } from '../styles';
6import { FormHelperTextClasses } from './formHelperTextClasses';
7
8export interface FormHelperTextPropsVariantOverrides {}
9
10export interface FormHelperTextOwnProps {
11 /**
12 * The content of the component.
13 *
14 * If `' '` is provided, the component reserves one line height for displaying a future message.
15 */
16 children?: React.ReactNode;
17 /**
18 * Override or extend the styles applied to the component.
19 */
20 classes?: Partial<FormHelperTextClasses>;
21 /**
22 * If `true`, the helper text should be displayed in a disabled state.
23 */
24 disabled?: boolean;
25 /**
26 * If `true`, helper text should be displayed in an error state.
27 */
28 error?: boolean;
29 /**
30 * If `true`, the helper text should use filled classes key.
31 */
32 filled?: boolean;
33 /**
34 * If `true`, the helper text should use focused classes key.
35 */
36 focused?: boolean;
37 /**
38 * If `dense`, will adjust vertical spacing. This is normally obtained via context from
39 * FormControl.
40 */
41 margin?: 'dense';
42 /**
43 * If `true`, the helper text should use required classes key.
44 */
45 required?: boolean;
46 /**
47 * The system prop that allows defining system overrides as well as additional CSS styles.
48 */
49 sx?: SxProps<Theme>;
50 /**
51 * The variant to use.
52 */
53 variant?: OverridableStringUnion<
54 'standard' | 'outlined' | 'filled',
55 FormHelperTextPropsVariantOverrides
56 >;
57}
58
59export interface FormHelperTextTypeMap<
60 AdditionalProps = {},
61 RootComponent extends React.ElementType = 'p',
62> {
63 props: AdditionalProps & FormHelperTextOwnProps;
64 defaultComponent: RootComponent;
65}
66/**
67 *
68 * Demos:
69 *
70 * - [Text Field](https://mui.com/material-ui/react-text-field/)
71 *
72 * API:
73 *
74 * - [FormHelperText API](https://mui.com/material-ui/api/form-helper-text/)
75 */
76declare const FormHelperText: OverridableComponent<FormHelperTextTypeMap>;
77
78export type FormHelperTextProps<
79 RootComponent extends React.ElementType = FormHelperTextTypeMap['defaultComponent'],
80 AdditionalProps = {},
81> = OverrideProps<FormHelperTextTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
82 component?: React.ElementType;
83};
84
85export default FormHelperText;