UNPKG

1.89 kBTypeScriptView Raw
1import { PropTypes } from '..';
2import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
3import { OverrideProps } from '../OverridableComponent';
4
5export type FabTypeMap<P = {}, D extends React.ElementType = 'button'> = ExtendButtonBaseTypeMap<{
6 props: P & {
7 /**
8 * The content of the button.
9 */
10 children: NonNullable<React.ReactNode>;
11 /**
12 * The color of the component. It supports those theme colors that make sense for this component.
13 */
14 color?: PropTypes.Color;
15 /**
16 * If `true`, the button will be disabled.
17 */
18 disabled?: boolean;
19 /**
20 * If `true`, the keyboard focus ripple will be disabled.
21 */
22 disableFocusRipple?: boolean;
23 /**
24 * If `true`, the ripple effect will be disabled.
25 */
26 disableRipple?: boolean;
27 /**
28 * The URL to link to when the button is clicked.
29 * If defined, an `a` element will be used as the root node.
30 */
31 href?: string;
32 /**
33 * The size of the button.
34 * `small` is equivalent to the dense button styling.
35 */
36 size?: 'small' | 'medium' | 'large';
37 /**
38 * The variant to use.
39 */
40 variant?: 'round' | 'extended';
41 };
42 defaultComponent: D;
43 classKey: FabClassKey;
44}>;
45
46/**
47 *
48 * Demos:
49 *
50 * - [Floating Action Button](https://material-ui.com/components/floating-action-button/)
51 *
52 * API:
53 *
54 * - [Fab API](https://material-ui.com/api/fab/)
55 * - inherits [ButtonBase API](https://material-ui.com/api/button-base/)
56 */
57declare const Fab: ExtendButtonBase<FabTypeMap>;
58
59export type FabProps<
60 D extends React.ElementType = FabTypeMap['defaultComponent'],
61 P = {}
62> = OverrideProps<FabTypeMap<P, D>, D>;
63
64export type FabClassKey =
65 | 'root'
66 | 'label'
67 | 'primary'
68 | 'secondary'
69 | 'extended'
70 | 'focusVisible'
71 | 'disabled'
72 | 'colorInherit'
73 | 'sizeSmall'
74 | 'sizeMedium';
75
76export default Fab;