UNPKG

2.33 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { Theme } from '..';
4import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
5import { OverrideProps } from '../OverridableComponent';
6import { BottomNavigationActionClasses } from './bottomNavigationActionClasses';
7
8export interface BottomNavigationActionOwnProps {
9 /**
10 * This prop isn't supported.
11 * Use the `component` prop if you need to change the children structure.
12 */
13 children?: React.ReactNode;
14 /**
15 * Override or extend the styles applied to the component.
16 */
17 classes?: Partial<BottomNavigationActionClasses>;
18 /**
19 * The icon to display.
20 */
21 icon?: React.ReactNode;
22 /**
23 * The label element.
24 */
25 label?: React.ReactNode;
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 * The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
32 */
33 showLabel?: boolean;
34 /**
35 * The system prop that allows defining system overrides as well as additional CSS styles.
36 */
37 sx?: SxProps<Theme>;
38 /**
39 * You can provide your own value. Otherwise, we fallback to the child position index.
40 */
41 value?: any;
42}
43
44export type BottomNavigationActionTypeMap<
45 AdditionalProps,
46 RootComponent extends React.ElementType,
47> = ExtendButtonBaseTypeMap<{
48 props: AdditionalProps & BottomNavigationActionOwnProps;
49 defaultComponent: RootComponent;
50}>;
51
52/**
53 *
54 * Demos:
55 *
56 * - [Bottom Navigation](https://mui.com/material-ui/react-bottom-navigation/)
57 *
58 * API:
59 *
60 * - [BottomNavigationAction API](https://mui.com/material-ui/api/bottom-navigation-action/)
61 * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
62 */
63declare const BottomNavigationAction: ExtendButtonBase<
64 BottomNavigationActionTypeMap<{}, ButtonBaseTypeMap['defaultComponent']>
65>;
66
67export type BottomNavigationActionProps<
68 RootComponent extends React.ElementType = ButtonBaseTypeMap['defaultComponent'],
69 AdditionalProps = {},
70> = OverrideProps<BottomNavigationActionTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
71 component?: React.ElementType;
72};
73
74export default BottomNavigationAction;