feature-content-blocks
Renders the CMS blocks a page is composed of — campaign banners, columns, teasers, promos, USP bands, product, category, brand and article lists, rich text, FAQs, tips and video.
Get started
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/feature-content-blocks @labdigital/graphql-fetcher @tanstack/react-query graphql next-intl reactRequirements5
@labdigital/graphql-fetcher>=3@tanstack/react-query>=5graphql>=16next-intl>=4react>=19Import its styles in the stylesheet where you load Tailwind. Without them the components render unstyled.
@import "@evolve-storefront/feature-content-blocks/styles.css";Wrap your app in
ContentAudienceProvider. Setup lists its props.Add its translations to your message files with
evolve messages.
Then render it on a page:
// app/[locale]/[...slug]/content-page.tsximport { ContentBlocks, defaultBlocks, PageHeading } from "@evolve-storefront/feature-content-blocks/content-blocks";import { contentPageQueryOptions } from "@evolve-storefront/feature-content-blocks/queries";import type { ClientFetcher } from "@labdigital/graphql-fetcher";import { QueryClient } from "@tanstack/react-query";
export async function ContentPage({ gqlClient, path }: { gqlClient: ClientFetcher; path: string }) { const page = await new QueryClient().fetchQuery(contentPageQueryOptions({ gqlClient, path })); if (!page) return null; return ( <main> <PageHeading page={page} /> <ContentBlocks blocks={page.body} registry={defaultBlocks} headingLevel={2} /> </main> );}Components
What you place on your pages. Each one has a preview, its props, and how to change its layout.
ContentAudienceShows its children only to their audience.
ContentBlocksRenders a list of CMS blocks.
Hooks
3 hooks to read and change the data yourself, for when you build your own UI. All hooks
More in this package
- Setup and server: what the package needs in your project.
- Advanced: graphql documents, data and cache helpers, other functions and constants, types.

