Breadcrumb
Breadcrumb shows the current location in a nested route or information hierarchy.
@duskmoon-dev/components/breadcrumb Usage
When to use
- Use it when users need to move between sections, pages, steps, or contextual actions.
- Expose current and disabled state so navigation remains clear to keyboard and screen-reader users.
Implementation notes
Features
Covers the route, section, step, or action-list patterns that help users move through an interface.
Shows selected, active, open, or current props where the component exposes them.
Breadcrumb is most often configured through `items`, `routes`, `params`, `separator`.
Renders items with links, current item, and default separator
Feature Demos
Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.
Basic usage
Import the component stylesheet and Breadcrumb from its package subpath, then render it with the core props.
import "@duskmoon-dev/components/styles.css";
import { Breadcrumb } from "@duskmoon-dev/components/breadcrumb";
export function Example() {
return (<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>);
} Renders items with links, current item, and default separator
test-backedBreadcrumb scenario from the component test coverage: renders items with links, current item, and default separator.
import "@duskmoon-dev/components/styles.css";
import { Breadcrumb } from "@duskmoon-dev/components/breadcrumb";
export function BreadcrumbRendersItemsWithLinksDemo() {
return (<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>);
} Supports route-style data, params, custom separator, and itemRender
test-backedBreadcrumb scenario from the component test coverage: supports route-style data, params, custom separator, and itemrender.
import "@duskmoon-dev/components/styles.css";
import { Breadcrumb } from "@duskmoon-dev/components/breadcrumb";
export function BreadcrumbSupportsRouteStyleDataDemo() {
return (<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>);
} Renders menu item data with click payloads
test-backedBreadcrumb scenario from the component test coverage: renders menu item data with click payloads.
import "@duskmoon-dev/components/styles.css";
import { Breadcrumb } from "@duskmoon-dev/components/breadcrumb";
export function BreadcrumbRendersMenuItemDataDemo() {
return (<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>);
} Supports explicit separator items, className, and ref
test-backedBreadcrumb scenario from the component test coverage: supports explicit separator items, classname, and ref.
import "@duskmoon-dev/components/styles.css";
import { Breadcrumb } from "@duskmoon-dev/components/breadcrumb";
export function BreadcrumbSupportsExplicitSeparatorItemsDemo() {
return (<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>);
} Theme aware
Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.
<div data-theme="sunshine">
<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>
</div>
<div data-theme="moonlight">
<Breadcrumb
items={[
{ title: "Home", href: "/" },
{ title: "Components", href: "/components" },
{ title: "Breadcrumb" }
]}
/>
</div> API
The API reference below lists every parsed exported type or interface for Breadcrumb. Start with `items`, `routes`, `params`, `separator` for common usage.
packages/components/src/components/breadcrumb/Breadcrumb.types.ts
Scenarios: packages/components/src/components/breadcrumb/Breadcrumb.test.tsx | Prop | Type | Required | Description |
|---|---|---|---|
items | BreadcrumbItemType[] | No | items configures Breadcrumb. |
routes | BreadcrumbRoute[] | No | routes configures Breadcrumb. |
params | BreadcrumbParams | No | params configures Breadcrumb. |
separator | ReactNode | No | separator configures Breadcrumb. |
itemRender | BreadcrumbItemRender | No | itemRender configures Breadcrumb. |
children | ReactNode | No | children configures Breadcrumb. |
| Prop | Type | Required | Description |
|---|---|---|---|
key | Key | Yes | key configures Breadcrumb. |
item | BreadcrumbMenuItemType | Yes | item configures Breadcrumb. |
domEvent | MouseEvent<HTMLElement> | Yes | domEvent configures Breadcrumb. |
| Prop | Type | Required | Description |
|---|---|---|---|
key | Key | No | key configures Breadcrumb. |
label | ReactNode | No | label configures Breadcrumb. |
title | ReactNode | No | title configures Breadcrumb. |
href | string | No | href configures Breadcrumb. |
path | string | No | path configures Breadcrumb. |
icon | ReactNode | No | icon configures Breadcrumb. |
disabled | boolean | No | disabled configures Breadcrumb. |
onClick | MouseEventHandler<HTMLElement> | No | onClick configures Breadcrumb. |
children | BreadcrumbMenuItemType[] | No | children configures Breadcrumb. |
| Prop | Type | Required | Description |
|---|---|---|---|
items | BreadcrumbMenuItemType[] | No | items configures Breadcrumb. |
onClick | (info: BreadcrumbMenuClickInfo) => void | No | onClick configures Breadcrumb. |
selectedKeys | Key[] | No | selectedKeys configures Breadcrumb. |
| Prop | Type | Required | Description |
|---|---|---|---|
key | Key | No | key configures Breadcrumb. |
title | ReactNode | No | title configures Breadcrumb. |
label | ReactNode | No | label configures Breadcrumb. |
breadcrumbName | ReactNode | No | breadcrumbName configures Breadcrumb. |
path | string | No | path configures Breadcrumb. |
href | string | No | href configures Breadcrumb. |
icon | ReactNode | No | icon configures Breadcrumb. |
disabled | boolean | No | disabled configures Breadcrumb. |
menu | BreadcrumbMenuProps | No | menu configures Breadcrumb. |
onClick | MouseEventHandler<HTMLElement> | No | onClick configures Breadcrumb. |
children | BreadcrumbRoute[] | No | children configures Breadcrumb. |
| Prop | Type | Required | Description |
|---|---|---|---|
type | "separator" | Yes | type configures Breadcrumb. |
key | Key | No | key configures Breadcrumb. |
separator | ReactNode | No | separator configures Breadcrumb. |
className | string | No | className configures Breadcrumb. |
Record<string, string | number | undefined> BreadcrumbRoute | BreadcrumbSeparatorType ( route: BreadcrumbRoute, params: BreadcrumbParams, routes: BreadcrumbRoute[], paths: string[], ) => ReactNode ForwardRefExoticComponent< BreadcrumbProps & RefAttributes<HTMLElement> >