HextaUI

Breadcrumb: Link component

Use the render prop to swap the anchor for your router's link, like Next.js <Link />.

import Link from "next/link"

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

export function BreadcrumbLinkComponent() {
  return (
    <Breadcrumb>
      <BreadcrumbList>
        <BreadcrumbItem>
          <BreadcrumbLink render={<Link href="/" />}>Home</BreadcrumbLink>
        </BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem>
          <BreadcrumbLink render={<Link href="/docs" />}>Docs</BreadcrumbLink>
        </BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem>
          <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
        </BreadcrumbItem>
      </BreadcrumbList>
    </Breadcrumb>
  )
}

This adds the example as components/examples/breadcrumb/link-component.tsx, together with the Breadcrumb component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/breadcrumb-link-component.json

To add only the component, follow the Breadcrumb installation.

Props in this example

The Breadcrumb props this example sets, from the API reference.

PropTypeDefault
renderPass your router’s link component here.
ReactElement | (props, state) => ReactElement<a>

Every prop is in the Breadcrumb API reference.

See them all, with keyboard support and accessibility notes, on the Breadcrumb page.