Bottom Navigation
Switch between a small number of primary destinations on compact screens.
This guide covers Material UI Core with the default Emotion engine; extensions and additional demos are explicitly classified.
Use case and business boundary
Selected values do not navigate by themselves; connect real routes without discarding native keyboard behavior.
Native composition and scope
BottomNavigation, BottomNavigationAction
Preserve native Material UI composition and types; do not substitute JGuang UI/Base UI/Radix APIs. Example entries are not extra components.
Native installation and initialization
npm install @mui/material@9.4.0 @emotion/react@11.14.0 @emotion/styled@11.14.1
Use native npm and Emotion, not an invented JGuang UI Registry URL. Place examples inside native ThemeProvider; choose CssBaseline or ScopedCssBaseline for the project. Inspect React, existing providers, lockfile and SSR first. Never overwrite files or conceal peer conflicts. This batch verified React 19.2.8; React 18 and below require matching react-is. See the included bilingual setup guide.
Practical native parameters
These selected parameters are not a flattened universal API. Preserve the native declaring owner, slot structure, nullable values and generics.
| Owner.prop | Practical role | Declaration source |
|---|---|---|
BottomNavigation.value | Controlled native value; its scalar/array/nullable type is owner-specific. | BottomNavigation |
BottomNavigation.onChange | Owning control's native callback; preserve its exact event/value/nullable signature. | BottomNavigation |
BottomNavigation.showLabels | Keep every BottomNavigation label visible, not only the selected one. | BottomNavigation |
BottomNavigationAction.label | Native visible label/content; not necessarily the underlying value. | BottomNavigationAction |
Runnable native examples
Machine keys select example entries, not universal variant props. Native demo JSX/data stay unchanged; JGuang-authored acceptance fixtures are explicitly labelled.
- Bottom navigation ·
SimpleBottomNavigation· upstream native demo - Bottom navigation with no label ·
LabelBottomNavigation· upstream native demo - Fixed positioning ·
FixedBottomNavigation· upstream native demo
Actual usage example
Unmodified pinned native demo; copy its required local helper files together.
import * as React from 'react';
import Box from '@mui/material/Box';
import BottomNavigation from '@mui/material/BottomNavigation';
import BottomNavigationAction from '@mui/material/BottomNavigationAction';
import RestoreIcon from '@mui/icons-material/Restore';
import FavoriteIcon from '@mui/icons-material/Favorite';
import LocationOnIcon from '@mui/icons-material/LocationOn';
export default function SimpleBottomNavigation() {
const [value, setValue] = React.useState(0);
return (
<Box sx={{ width: 500 }}>
<BottomNavigation
showLabels
value={value}
onChange={(event, newValue) => {
setValue(newValue);
}}
>
<BottomNavigationAction label="Recents" icon={<RestoreIcon />} />
<BottomNavigationAction label="Favorites" icon={<FavoriteIcon />} />
<BottomNavigationAction label="Nearby" icon={<LocationOnIcon />} />
</BottomNavigation>
</Box>
);
}
Example dependency boundaries
react, @mui/material/Box, @mui/material/BottomNavigation, @mui/material/BottomNavigationAction, @mui/icons-material/Restore, @mui/icons-material/Favorite, @mui/icons-material/LocationOn, @mui/icons-material/Folder, @mui/material/CssBaseline, @mui/icons-material/Archive, @mui/material/Paper, @mui/material/List, @mui/material/ListItemButton, @mui/material/ListItemAvatar, @mui/material/ListItemText, @mui/material/Avatar
Direct Icons/System/Utils example imports require their matching 9.4.0 packages. Relative data/helpers are part of the example closure, not extra components. Remote images and simulated operations do not supply a backend.
Pinned upstream API metadata reference
These tables retain the upstream metadata, not a newly inferred generic type system. Conditional generics, inherited props and callback details are defined by the source declarations below. Theme defaults may override metadata defaults.
BottomNavigation
import BottomNavigation from '@mui/material/BottomNavigation';
import { BottomNavigation } from '@mui/material';
| Prop | Required | Upstream metadata type / constraint | Metadata default |
|---|---|---|---|
children | no | node | — |
classes | no | object | — |
component | no | elementType | — |
onChange | no | func | — |
showLabels | no | bool | false |
sx | no | Array<func | object | bool> | func | object | — |
value | no | any | — |
BottomNavigationAction
import BottomNavigationAction from '@mui/material/BottomNavigationAction';
import { BottomNavigationAction } from '@mui/material';
Native inheritance: ButtonBase. Parent/DOM props are not fabricated as additional own props.
| Prop | Required | Upstream metadata type / constraint | Metadata default |
|---|---|---|---|
children | no | unsupportedProp | — |
classes | no | object | — |
icon | no | node | — |
label | no | node | — |
showLabel | no | bool | — |
slotProps | no | { label?: func | object, root?: func | object } | {} |
slots | no | { label?: elementType, root?: elementType } | {} |
sx | no | Array<func | object | bool> | func | object | — |
value | no | any | — |
Native source declarations
Declarations/imports are extracted from pinned source without flattening unions or external inheritance. Original English comments/types are source reference, not a claim of translated upstream prose. Shared types stay in their native packages.
vendor/src/BottomNavigation/BottomNavigation.d.ts
import * as React from 'react';
import { SxProps } from '@mui/system';
import { Theme } from '../styles';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { BottomNavigationClasses } from './bottomNavigationClasses';
export interface BottomNavigationOwnProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<BottomNavigationClasses> | undefined;
/**
* Callback fired when the value changes.
*
* @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
* @param {any} value We default to the index of the child.
*/
onChange?: ((event: React.SyntheticEvent, value: any) => void) | undefined;
/**
* If `true`, all `BottomNavigationAction`s will show their labels.
* By default, only the selected `BottomNavigationAction` will show its label.
* @default false
*/
showLabels?: boolean | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
/**
* The value of the currently selected `BottomNavigationAction`.
*/
value?: any;
}
export interface BottomNavigationTypeMap<
AdditionalProps = {},
RootComponent extends React.ElementType = 'div',
> {
props: AdditionalProps & BottomNavigationOwnProps;
defaultComponent: RootComponent;
}
declare const BottomNavigation: OverridableComponent<BottomNavigationTypeMap>;
export type BottomNavigationProps<
RootComponent extends React.ElementType = BottomNavigationTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<BottomNavigationTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType | undefined;
};
vendor/src/BottomNavigationAction/BottomNavigationAction.d.ts
import * as React from 'react';
import { SxProps } from '@mui/system';
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
import { Theme } from '../styles';
import {
ButtonBaseProps,
ButtonBaseTypeMap,
ExtendButtonBase,
ExtendButtonBaseTypeMap,
} from '../ButtonBase';
import { OverrideProps } from '../OverridableComponent';
import { BottomNavigationActionClasses } from './bottomNavigationActionClasses';
export interface BottomNavigationActionSlots {
/**
* The component that renders the root.
* @default ButtonBase
*/
root: React.ElementType;
/**
* The component that renders the label.
* @default span
*/
label: React.ElementType;
}
export type BottomNavigationActionSlotsAndSlotProps = CreateSlotsAndSlotProps<
BottomNavigationActionSlots,
{
/**
* Props forwarded to the root slot.
* By default, the available props are based on the ButtonBase element.
*/
root: SlotProps<React.ElementType<ButtonBaseProps>, {}, BottomNavigationActionOwnerState>;
/**
* Props forwarded to the label slot.
* By default, the available props are based on the span element.
*/
label: SlotProps<'span', {}, BottomNavigationActionOwnerState>;
}
>;
export interface BottomNavigationActionOwnProps extends BottomNavigationActionSlotsAndSlotProps {
/**
* This prop isn't supported.
* Use the `component` prop if you need to change the children structure.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<BottomNavigationActionClasses> | undefined;
/**
* The icon to display.
*/
icon?: React.ReactNode;
/**
* The label element.
*/
label?: React.ReactNode;
/**
* If `true`, the `BottomNavigationAction` will show its label.
* By default, only the selected `BottomNavigationAction`
* inside `BottomNavigation` will show its label.
*
* The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
*/
showLabel?: boolean | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
/**
* You can provide your own value. Otherwise, we fallback to the child position index.
*/
value?: any;
}
export type BottomNavigationActionTypeMap<
AdditionalProps,
RootComponent extends React.ElementType,
> = ExtendButtonBaseTypeMap<{
props: AdditionalProps & BottomNavigationActionOwnProps;
defaultComponent: RootComponent;
}>;
declare const BottomNavigationAction: ExtendButtonBase<
BottomNavigationActionTypeMap<{}, ButtonBaseTypeMap['defaultComponent']>
>;
export type BottomNavigationActionProps<
RootComponent extends React.ElementType = ButtonBaseTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<BottomNavigationActionTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType | undefined;
};
export interface BottomNavigationActionOwnerState extends Omit<
BottomNavigationActionProps,
'slots' | 'slotProps'
> {}
Post-install acceptance
Run strict types, production build and real interactions. Check keyboard labels/focus, disabled/error/read-only semantics where natively supported, both themes, narrow screens and reduced motion. Verify callbacks against the real host data; do not declare installation complete from copying a prompt. Initialization fixtures also require server HTML and warning-free hydration.
Source and license
https://github.com/mui/material-ui/tree/809a7717b4c050ba3f69b75300689f07c050a16e
MIT · @mui/material@9.4.0. Vendor originals and license are preserved. Full original upstream prose remains in vendor/docs and is not represented as fully translated.