import { type ComponentPropsWithoutRef, type ElementType } from 'react'; /** A single item in the breadcrumb list. */ export type BreadcrumbItem = { /** The display label of the page. */ label: string; /** * The URL to link to. * Providing an `href` on the last item renders it as a link instead of the current page. */ href?: string; }; export type BreadcrumbsProps = { /** * Array of breadcrumb items. * The last item is treated as the current page (non-link, `aria-current="page"`) when it has no `href`. * If the last item has an `href`, it is rendered as a link and the trail has no current-page item. * If only one item is provided, only that item is shown. */ items: BreadcrumbItem[]; /** * Whether to allow text wrapping. * When `true`, items wrap to multiple lines (truncation is disabled). * When `false` (default), items stay on one line and overflowing middle items are truncated. * In wrap mode, each item includes a separator to prevent separators from appearing at line starts. * * @default false */ wrap?: boolean; /** * Custom link component (e.g. Next.js Link). * Falls back to a plain `` tag when omitted. * Also applied to truncated items in the DropdownMenu. */ customLinkComponent?: ElementType; } & ComponentPropsWithoutRef<'nav'>;