UNPKG

1.03 kBTypeScriptView Raw
1import * as React from 'react';
2import { PropTypes } from '..';
3import { OverridableComponent, OverrideProps } from '../OverridableComponent';
4
5export interface IconTypeMap<P = {}, D extends React.ElementType = 'span'> {
6 props: P & {
7 color?: PropTypes.Color | 'action' | 'disabled' | 'error';
8 fontSize?: 'default' | 'inherit' | 'large' | 'medium' | 'small';
9 };
10 defaultComponent: D;
11 classKey: IconClassKey;
12}
13/**
14 *
15 * Demos:
16 *
17 * - [Icons](https://mui.com/components/icons/)
18 * - [Material Icons](https://mui.com/components/material-icons/)
19 *
20 * API:
21 *
22 * - [Icon API](https://mui.com/api/icon/)
23 */
24declare const Icon: OverridableComponent<IconTypeMap>;
25
26export type IconClassKey =
27 | 'root'
28 | 'colorSecondary'
29 | 'colorAction'
30 | 'colorDisabled'
31 | 'colorError'
32 | 'colorPrimary'
33 | 'fontSizeInherit'
34 | 'fontSizeSmall'
35 | 'fontSizeLarge';
36
37export type IconProps<
38 D extends React.ElementType = IconTypeMap['defaultComponent'],
39 P = {}
40> = OverrideProps<IconTypeMap<P, D>, D>;
41
42export default Icon;