robertlib

Breadcrumbs

Navigation

About

A breadcrumb trail showing the path from the home page to the current page, with a home icon, truncation of long labels, and automatic collapsing with an expandable "…" when there are too many crumbs to fit.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Breadcrumbs to your project and fits it to your theme.

Code

How Breadcrumbs is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import Breadcrumbs from "@/components/ui/breadcrumbs";
import { ChevronRight } from "lucide-react";

const path = [
  { href: "/projects", label: "Projects" },
  { href: "/projects/website-redesign", label: "Website redesign" },
  { href: "/projects/website-redesign/pages", label: "Pages" },
  { href: "/projects/website-redesign/pages/about", label: "About us" },
  { label: "Edit" },
];

export default function CollapsedBreadcrumbsDemo() {
  return (
    <div className="space-y-4 p-6">
      {/* Home, "…" and the last two - the "…" shows the whole path */}
      <Breadcrumbs itemsAfterCollapse={2} items={path} maxItems={4} />
      <Breadcrumbs
        home={false}
        items={path}
        separator={<ChevronRight size={14} />}
      />
      <Breadcrumbs home={false} items={path} separator="/" />
    </div>
  );
}

Dependencies

More by robertlib

View all
  • Timeline

    Timeline

    17
  • Chip

    Chip

    7
  • Switch

    Switch

    7
  • Spinner

    Spinner

    5
  • Progress Indicator

    Progress Indicator

    5
  • Collapsible Content

    Collapsible Content

    4
  • Empty State

    Empty State

    4
  • Checkbox

    Checkbox

    3

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    67
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    193
  • Sidebar

    Sidebar

    408
  • Button Breadcrumb

    Button Breadcrumb

    34
  • Menu

    Menu

    26
  • Breadcrumb

    Breadcrumb

    7
  • Pagination with Ellipsis

    Pagination with Ellipsis

    25
  • Pagination with Icon and Label

    Pagination with Icon and Label

    24