@mui/material
Version:
React components that implement Google's Material Design.
103 lines (96 loc) • 2.9 kB
TypeScript
import * as React from 'react';
import { SxProps } from '@mui/system';
import { SlotComponentProps } from '@mui/base';
import { Theme } from '../styles';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { BreadcrumbsClasses } from './breadcrumbsClasses';
import SvgIcon from '../SvgIcon';
export interface BreadcrumbsCollapsedIconSlotPropsOverrides {}
export interface BreadcrumbsOwnerState extends BreadcrumbsProps {
expanded: boolean;
}
export interface BreadcrumbsTypeMap<P = {}, D extends React.ElementType = 'nav'> {
props: P & {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<BreadcrumbsClasses>;
/**
* The components used for each slot inside the Breadcumb.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots?: {
CollapsedIcon?: React.ElementType;
};
/**
* The props used for each slot inside the Breadcumb.
* @default {}
*/
slotProps?: {
/**
* Props applied to the CollapsedIcon slot.
* @default {}
*/
collapsedIcon?: SlotComponentProps<
typeof SvgIcon,
BreadcrumbsCollapsedIconSlotPropsOverrides,
BreadcrumbsOwnerState
>;
};
/**
* Override the default label for the expand button.
*
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
* @default 'Show path'
*/
expandText?: string;
/**
* If max items is exceeded, the number of items to show after the ellipsis.
* @default 1
*/
itemsAfterCollapse?: number;
/**
* If max items is exceeded, the number of items to show before the ellipsis.
* @default 1
*/
itemsBeforeCollapse?: number;
/**
* Specifies the maximum number of breadcrumbs to display. When there are more
* than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
* will be shown, with an ellipsis in between.
* @default 8
*/
maxItems?: number;
/**
* Custom separator node.
* @default '/'
*/
separator?: React.ReactNode;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
};
defaultComponent: D;
}
/**
*
* Demos:
*
* - [Breadcrumbs](https://mui.com/material-ui/react-breadcrumbs/)
*
* API:
*
* - [Breadcrumbs API](https://mui.com/material-ui/api/breadcrumbs/)
*/
declare const Breadcrumbs: OverridableComponent<BreadcrumbsTypeMap>;
export type BreadcrumbsProps<
D extends React.ElementType = BreadcrumbsTypeMap['defaultComponent'],
P = {},
> = OverrideProps<BreadcrumbsTypeMap<P, D>, D>;
export default Breadcrumbs;