PRIZM 4.0DSTA
All components

Breadcrumb

Hierarchical navigation trail.

stable

Preview

Code

tsx
import {
  Breadcrumb, BreadcrumbItem, BreadcrumbLink,
  BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";

export function Example() {
  return (
    <Breadcrumb>
      <BreadcrumbList>
        <BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem><BreadcrumbLink href="/components">Components</BreadcrumbLink></BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem><BreadcrumbPage>Breadcrumb</BreadcrumbPage></BreadcrumbItem>
      </BreadcrumbList>
    </Breadcrumb>
  );
}

Props

PropTypeDefaultDescription
classNamestringAdditional Tailwind classes, merged with the component's defaults via cn().

Sub-components

BreadcrumbList`<ol>` for the items.
BreadcrumbItemEach step.
BreadcrumbLinkClickable previous step.
BreadcrumbPageCurrent page — marked `aria-current="page"`, non-clickable.
BreadcrumbSeparatorChevron divider between items.

Root renders `<nav aria-label="Breadcrumb">`.

All components also accept standard HTML attributes for their root element (e.g. `id`, `aria-*`, `data-*`, event handlers) and forward `ref` where applicable.

Source

The full implementation of components/ui/breadcrumb.tsx is below — copy it into your project and own it. Some components import the cn helper from lib/utils or other primitives; copy those too.

tsx
import { cn } from "@/lib/utils";
import { ChevronRight } from "lucide-react";
import { type ComponentProps, forwardRef } from "react";

export const Breadcrumb = forwardRef<HTMLElement, ComponentProps<"nav">>(
  ({ className, ...props }, ref) => (
    <nav ref={ref} aria-label="Breadcrumb" className={cn("text-sm", className)} {...props} />
  ),
);
Breadcrumb.displayName = "Breadcrumb";

export const BreadcrumbList = forwardRef<HTMLOListElement, ComponentProps<"ol">>(
  ({ className, ...props }, ref) => (
    <ol
      ref={ref}
      className={cn("flex flex-wrap items-center gap-1.5 text-fg-muted", className)}
      {...props}
    />
  ),
);
BreadcrumbList.displayName = "BreadcrumbList";

export const BreadcrumbItem = forwardRef<HTMLLIElement, ComponentProps<"li">>(
  ({ className, ...props }, ref) => (
    <li ref={ref} className={cn("inline-flex items-center gap-1.5", className)} {...props} />
  ),
);
BreadcrumbItem.displayName = "BreadcrumbItem";

export const BreadcrumbLink = forwardRef<HTMLAnchorElement, ComponentProps<"a">>(
  ({ className, ...props }, ref) => (
    <a ref={ref} className={cn("transition-colors hover:text-fg", className)} {...props} />
  ),
);
BreadcrumbLink.displayName = "BreadcrumbLink";

export const BreadcrumbPage = forwardRef<HTMLSpanElement, ComponentProps<"span">>(
  ({ className, ...props }, ref) => (
    <span
      ref={ref}
      aria-current="page"
      className={cn("font-medium text-fg", className)}
      {...props}
    />
  ),
);
BreadcrumbPage.displayName = "BreadcrumbPage";

export function BreadcrumbSeparator({ className, ...props }: ComponentProps<"span">) {
  return (
    <span
      role="presentation"
      aria-hidden="true"
      className={cn("text-fg-subtle", className)}
      {...props}
    >
      <ChevronRight className="h-3.5 w-3.5" />
    </span>
  );
}

JavaFX

Ships in the PRIZM JavaFX library for thick-client C3 apps as PrizmBreadcrumb (extends HBox). Run the gallery to see it natively.

java
import design.prizm.fx.controls.PrizmBreadcrumb;

PrizmBreadcrumb()
PropTypeDefaultDescription
addCrumb(String) → HyperlinkAdd a clickable ancestor crumb (wire setOnAction).
addCurrent(String) → LabelAdd the non-link current page (the tail).

Composite HBox of muted crumb links separated by chevrons, ending in the current page. Mirrors components/ui/breadcrumb.tsx.