UNPKG

1.54 kBTypeScriptView Raw
1import { PropTypes } from '..';
2import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
3import { OverrideProps } from '../OverridableComponent';
4
5export type IconButtonTypeMap<
6 P = {},
7 D extends React.ElementType = 'button'
8> = ExtendButtonBaseTypeMap<{
9 props: P & {
10 color?: PropTypes.Color;
11 disableFocusRipple?: boolean;
12 /**
13 * If given, uses a negative margin to counteract the padding on one
14 * side (this is often helpful for aligning the left or right
15 * side of the icon with content above or below, without ruining the border
16 * size and shape).
17 */
18 edge?: 'start' | 'end' | false;
19 size?: 'small' | 'medium';
20 };
21 defaultComponent: D;
22 classKey: IconButtonClassKey;
23}>;
24
25/**
26 * Refer to the [Icons](https://material-ui.com/components/icons/) section of the documentation
27 * regarding the available icon options.
28 * Demos:
29 *
30 * - [Buttons](https://material-ui.com/components/buttons/)
31 *
32 * API:
33 *
34 * - [IconButton API](https://material-ui.com/api/icon-button/)
35 * - inherits [ButtonBase API](https://material-ui.com/api/button-base/)
36 */
37declare const IconButton: ExtendButtonBase<IconButtonTypeMap>;
38
39export type IconButtonClassKey =
40 | 'root'
41 | 'edgeStart'
42 | 'edgeEnd'
43 | 'colorInherit'
44 | 'colorPrimary'
45 | 'colorSecondary'
46 | 'disabled'
47 | 'sizeSmall'
48 | 'label';
49
50export type IconButtonProps<
51 D extends React.ElementType = IconButtonTypeMap['defaultComponent'],
52 P = {}
53> = OverrideProps<IconButtonTypeMap<P, D>, D>;
54
55export default IconButton;