UNPKG

mui-extended

Version:

Extended UI Components built on Material UI

38 lines (37 loc) 1.08 kB
import { RichTreeViewProps } from "@mui/x-tree-view"; import { FunctionComponent, ReactNode } from "react"; type TreeLinkType = { link: string; label?: string; }; /** * #### Usage * - multi level links are separated by '/' * - label in later link overrides the label in previous links * * #### Example * ```typescript * const links: TreeMenuWithNextLinksProps = { * links: [ * "root", * "docs", * "/docs/getting-started", // leading and ending '/' are ignored * { * link: "docs/install/", * label: "Documentation/Install" * } * ] * } * ``` */ export type TreeMenuWithNextLinksProps<R extends Record<string, unknown> = Record<string, unknown>, Multiple extends boolean | undefined = false> = { links: (string | TreeLinkType)[]; improveLabels?: boolean; RichTreeViewProps?: Omit<RichTreeViewProps<R, Multiple>, "items">; }; export type LinkComponentType = { href: string; children: ReactNode; }; export declare const TreeMenuWithNextLinks: FunctionComponent<TreeMenuWithNextLinksProps>; export {};