Skip to content

layout

@evolve-storefront/layout · v1.0.0 · Storybook ↗

Page-level building blocks above the @evolve-storefront/ui primitives, such as breadcrumbs with their structured data for search engines. They fetch nothing: your app maps its own data onto a small contract, and the component renders it and emits the SEO metadata.

Get started

  1. Install the package with the peer dependencies it needs. It comes from the Evolve registry, which needs a one-time sign-in.

    pnpm add @evolve-storefront/layout graphql next next-intl react
    Requirements4
    graphql>=16
    next>=16.2.11 <17
    next-intl>=4
    react>=19
  2. Import its styles in the stylesheet where you load Tailwind. Without them the components render unstyled.

    @import "@evolve-storefront/layout/styles.css";
  3. Add its translations to your message files with evolve messages.

Then render it on a page:

import { Breadcrumbs } from "@evolve-storefront/layout/breadcrumbs";
import Link from "next/link";
type Crumb = { name: string; href: string };
export function ProductBreadcrumbs({ trail }: { trail: Crumb[] }) {
return (
<Breadcrumbs
// Ancestors first, the current page last; a Home item is prepended.
items={trail}
// Makes the structured data's URLs absolute, which search engines require.
origin="https://shop.example"
renderLink={({ href, children, className }) => (
<Link href={href} className={className}>
{children}
</Link>
)}
/>
);
}

Components

What you place on your pages. Each one has a preview, its props, and how to change its layout.

More in this package