UNPKG

1.34 kBTypeScriptView Raw
1import * as React from 'react';
2import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
3import { OverrideProps } from '../OverridableComponent';
4
5export type TabTypeMap<P = {}, D extends React.ElementType = 'div'> = ExtendButtonBaseTypeMap<{
6 props: P & {
7 disableFocusRipple?: boolean;
8 fullWidth?: boolean;
9 icon?: string | React.ReactElement;
10 label?: React.ReactNode;
11 onChange?: (event: React.ChangeEvent<{ checked: boolean }>, value: any) => void;
12 onClick?: React.EventHandler<any>;
13 selected?: boolean;
14 style?: React.CSSProperties;
15 textColor?: string | 'secondary' | 'primary' | 'inherit';
16 value?: any;
17 wrapped?: boolean;
18 };
19 defaultComponent: D;
20 classKey: TabClassKey;
21}>;
22
23/**
24 *
25 * Demos:
26 *
27 * - [Tabs](https://mui.com/components/tabs/)
28 *
29 * API:
30 *
31 * - [Tab API](https://mui.com/api/tab/)
32 * - inherits [ButtonBase API](https://mui.com/api/button-base/)
33 */
34declare const Tab: ExtendButtonBase<TabTypeMap>;
35
36export type TabClassKey =
37 | 'root'
38 | 'labelIcon'
39 | 'textColorInherit'
40 | 'textColorPrimary'
41 | 'textColorSecondary'
42 | 'selected'
43 | 'disabled'
44 | 'fullWidth'
45 | 'wrapped'
46 | 'wrapper';
47
48export type TabProps<
49 D extends React.ElementType = TabTypeMap['defaultComponent'],
50 P = {}
51> = OverrideProps<TabTypeMap<P, D>, D>;
52
53export default Tab;