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.
Using the JsonLdForBreadcrumb component
Section titled “Using the JsonLdForBreadcrumb component”-
Import the
JsonLdForBreadcrumbcomponent 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 (<><JsonLdForBreadcrumbitemList={[{ 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></>);} -
Check the generated JSON-LD by inspecting the body element of your page.
Related
Section titled “Related”View related API references.
JsonLdForBreadcrumb API Reference for the JsonLdForBreadcrumb component.