UNPKG

2.44 kBTypeScriptView Raw
1/// <reference types="react" />
2import { AbstractPureComponent, Boundary, Props } from "../../common";
3import { OverflowListProps } from "../overflow-list/overflowList";
4import { PopoverProps } from "../popover/popover";
5import { BreadcrumbProps } from "./breadcrumb";
6export interface BreadcrumbsProps extends Props {
7 /**
8 * Callback invoked to render visible breadcrumbs. Best practice is to
9 * render a `<Breadcrumb>` element. If `currentBreadcrumbRenderer` is also
10 * supplied, that callback will be used for the current breadcrumb instead.
11 *
12 * @default Breadcrumb
13 */
14 breadcrumbRenderer?: (props: BreadcrumbProps) => JSX.Element;
15 /**
16 * Which direction the breadcrumbs should collapse from: start or end.
17 *
18 * @default Boundary.START
19 */
20 collapseFrom?: Boundary;
21 /**
22 * Callback invoked to render the current breadcrumb, which is the last
23 * element in the `items` array.
24 *
25 * If this prop is omitted, `breadcrumbRenderer` will be invoked for the
26 * current breadcrumb instead.
27 */
28 currentBreadcrumbRenderer?: (props: BreadcrumbProps) => JSX.Element;
29 /**
30 * All breadcrumbs to display. Breadcrumbs that do not fit in the container
31 * will be rendered in an overflow menu instead.
32 */
33 items: readonly BreadcrumbProps[];
34 /**
35 * The minimum number of visible breadcrumbs that should never collapse into
36 * the overflow menu, regardless of DOM dimensions.
37 *
38 * @default 0
39 */
40 minVisibleItems?: number;
41 /**
42 * Props to spread to `OverflowList`. Note that `items`,
43 * `overflowRenderer`, and `visibleItemRenderer` cannot be changed.
44 */
45 overflowListProps?: Partial<Omit<OverflowListProps<BreadcrumbProps>, "items" | "overflowRenderer" | "visibleItemRenderer">>;
46 /**
47 * Props to spread to the popover showing the overflow menu.
48 */
49 popoverProps?: Partial<Omit<PopoverProps, "content" | "defaultIsOpen" | "disabled" | "fill" | "renderTarget" | "targetTagName">>;
50}
51/**
52 * Breadcrumbs component.
53 *
54 * @see https://blueprintjs.com/docs/#core/components/breadcrumbs
55 */
56export declare class Breadcrumbs extends AbstractPureComponent<BreadcrumbsProps> {
57 static defaultProps: Partial<BreadcrumbsProps>;
58 render(): JSX.Element;
59 private renderOverflow;
60 private renderOverflowBreadcrumb;
61 private renderBreadcrumbWrapper;
62 private renderBreadcrumb;
63}