UNPKG

2.61 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent, Boundary, type Props } from "../../common";
3import { type OverflowListProps } from "../overflow-list/overflowList";
4import { type PopoverProps } from "../popover/popover";
5import { type 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) => React.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) => React.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 the `OverflowList` popover target.
43 */
44 overflowButtonProps?: React.HTMLProps<HTMLSpanElement>;
45 /**
46 * Props to spread to `OverflowList`. Note that `items`,
47 * `overflowRenderer`, and `visibleItemRenderer` cannot be changed.
48 */
49 overflowListProps?: Partial<Omit<OverflowListProps<BreadcrumbProps>, "items" | "overflowRenderer" | "visibleItemRenderer">>;
50 /**
51 * Props to spread to the popover showing the overflow menu.
52 */
53 popoverProps?: Partial<Omit<PopoverProps, "content" | "defaultIsOpen" | "disabled" | "fill" | "renderTarget" | "targetTagName">>;
54}
55/**
56 * Breadcrumbs component.
57 *
58 * @see https://blueprintjs.com/docs/#core/components/breadcrumbs
59 */
60export declare class Breadcrumbs extends AbstractPureComponent<BreadcrumbsProps> {
61 static defaultProps: Partial<BreadcrumbsProps>;
62 render(): React.JSX.Element;
63 private renderOverflow;
64 private renderOverflowBreadcrumb;
65 private renderBreadcrumbWrapper;
66 private renderBreadcrumb;
67}