UNPKG

2.04 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { Theme } from '..';
4import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5import { BottomNavigationClasses } from './bottomNavigationClasses';
6
7export interface BottomNavigationOwnProps {
8 /**
9 * The content of the component.
10 */
11 children?: React.ReactNode;
12 /**
13 * Override or extend the styles applied to the component.
14 */
15 classes?: Partial<BottomNavigationClasses>;
16 /**
17 * Callback fired when the value changes.
18 *
19 * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
20 * @param {any} value We default to the index of the child.
21 */
22 onChange?: (event: React.SyntheticEvent, value: any) => void;
23 /**
24 * If `true`, all `BottomNavigationAction`s will show their labels.
25 * By default, only the selected `BottomNavigationAction` will show its label.
26 * @default false
27 */
28 showLabels?: boolean;
29 /**
30 * The system prop that allows defining system overrides as well as additional CSS styles.
31 */
32 sx?: SxProps<Theme>;
33 /**
34 * The value of the currently selected `BottomNavigationAction`.
35 */
36 value?: any;
37}
38
39export interface BottomNavigationTypeMap<
40 AdditionalProps = {},
41 RootComponent extends React.ElementType = 'div',
42> {
43 props: AdditionalProps & BottomNavigationOwnProps;
44 defaultComponent: RootComponent;
45}
46/**
47 *
48 * Demos:
49 *
50 * - [Bottom Navigation](https://mui.com/material-ui/react-bottom-navigation/)
51 *
52 * API:
53 *
54 * - [BottomNavigation API](https://mui.com/material-ui/api/bottom-navigation/)
55 */
56declare const BottomNavigation: OverridableComponent<BottomNavigationTypeMap>;
57
58export type BottomNavigationProps<
59 RootComponent extends React.ElementType = BottomNavigationTypeMap['defaultComponent'],
60 AdditionalProps = {},
61> = OverrideProps<BottomNavigationTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
62 component?: React.ElementType;
63};
64
65export default BottomNavigation;