Back to Twenty

Breadcrumb

packages/twenty-docs/twenty-ui/navigation/breadcrumb.mdx

2.2.01.0 KB
Original Source
<Frame> </Frame>

Renders a breadcrumb navigation bar.

<Tabs> <Tab title="Usage">
jsx
import { BrowserRouter } from "react-router-dom";
import { Breadcrumb } from "@/ui/navigation/bread-crumb/components/Breadcrumb";

export const MyComponent = () => {
  const breadcrumbLinks = [
    { children: "Home", href: "/" },
    { children: "Category", href: "/category" },
    { children: "Subcategory", href: "/category/subcategory" },
    { children: "Current Page" },
  ];

  return (
    <BrowserRouter>
      <Breadcrumb className links={breadcrumbLinks} />
    </BrowserRouter>
    )
};
</Tab> <Tab title="Props">
PropsTypeDescription
classNamestringOptional class name for additional styling
linksarrayAn array of objects, each representing a breadcrumb link. Each object has a children property (the text content of the link) and an optional href property (the URL to navigate to when the link is clicked)
</Tab> </Tabs>