Skip to content

Add Breadcrumb JSON-LD structured data to a page

seo-in-nextjs provides the JsonLdForBreadcrumb component to easily add Breadcrumb JSON-LD structured data to a page.

  1. Import the JsonLdForBreadcrumb component into every page where you want to generate the JSON-LD data.

    app/products/electronics/laptops/page.tsx
    import { JsonLdForBreadcrumb } from "@dlcastillop/seo-in-nextjs";
    export default function LaptopsPage() {
    return (
    <>
    <JsonLdForBreadcrumb
    itemList={[
    { name: "Home", route: "/" },
    { name: "Products", route: "/products" },
    { name: "Electronics", route: "/products/electronics" },
    { name: "Laptops", route: "/products/electronics/laptops" },
    ]}
    scriptKey="breadcrumb-json-ld"
    />
    <main>
    <h1>Laptops</h1>
    {/* Your content */}
    </main>
    </>
    );
    }
  2. Check the generated JSON-LD by inspecting the body element of your page.

View related API references.