UNPKG

1.88 kBTypeScriptView Raw
1import * as React from 'react';
2import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
3import { OverrideProps } from '../OverridableComponent';
4
5export type BottomNavigationActionTypeMap<
6 P,
7 D extends React.ElementType
8> = ExtendButtonBaseTypeMap<{
9 props: P & {
10 /**
11 * This prop isn't supported.
12 * Use the `component` prop if you need to change the children structure.
13 */
14 children?: React.ReactNode;
15 /**
16 * The icon element.
17 */
18 icon?: React.ReactNode;
19 /**
20 * The label element.
21 */
22 label?: React.ReactNode;
23 onChange?: (event: React.ChangeEvent<{}>, value: any) => void;
24 onClick?: React.ReactEventHandler<any>;
25 selected?: boolean;
26 /**
27 * If `true`, the `BottomNavigationAction` will show its label.
28 * By default, only the selected `BottomNavigationAction`
29 * inside `BottomNavigation` will show its label.
30 */
31 showLabel?: boolean;
32 /**
33 * You can provide your own value. Otherwise, we fallback to the child position index.
34 */
35 value?: any;
36 };
37 defaultComponent: D;
38 classKey: BottomNavigationActionClassKey;
39}>;
40
41/**
42 *
43 * Demos:
44 *
45 * - [Bottom Navigation](https://mui.com/components/bottom-navigation/)
46 *
47 * API:
48 *
49 * - [BottomNavigationAction API](https://mui.com/api/bottom-navigation-action/)
50 * - inherits [ButtonBase API](https://mui.com/api/button-base/)
51 */
52declare const BottomNavigationAction: ExtendButtonBase<BottomNavigationActionTypeMap<
53 {},
54 ButtonBaseTypeMap['defaultComponent']
55>>;
56
57export type BottomNavigationActionClassKey = 'root' | 'selected' | 'iconOnly' | 'wrapper' | 'label';
58
59export type BottomNavigationActionProps<
60 D extends React.ElementType = ButtonBaseTypeMap['defaultComponent'],
61 P = {}
62> = OverrideProps<BottomNavigationActionTypeMap<P, D>, D>;
63
64export default BottomNavigationAction;