Skip to Content
Strapi Page Builder 1.0 is now available 🎉

<Render /> Component

import strapiConfig from "@/config/strapiConfig"; import { Render } from "@wecre8websites/strapi-page-builder-react"; import { notFound } from "next/navigation"; import config from "../../blocks/PageBuilderConfig"; const strapiConfig = { url: process.env.NEXT_PUBLIC_API_URL as string, authToken: process.env.STRAPI_ADMIN_TOKEN as string, imageUrl: process.env.NEXT_PUBLIC_IMAGE_URL as string, } export default async function Page({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params; const { template, ...content } = await getCMSContent(locale) if (!template?.json || !content) return notFound(); return <Render config={config} data={{ templateJson: template.json, content }} strapi={{ ...strapiConfig, locale }} />; }

Props

ParameterDescriptionRequired
configThe configuration object for the Strapi Page Builder. See Editor Configuration.true
dataThe data payload for the renderertrue
strapiThe configuration object for Strapi.false

Data payload

ParameterDescriptionRequired
templateJsonThe JSON representation of the template, returned by the Strapi Page Builder template relation field of the requested content type.true
contentThe content object returned by the CMS or other external source. Required if using the processProps helper for rendering dynamic data. See Content Data for details.true

Strapi Configuration Object

ParameterDescriptionRequired
urlThe URL of the Strapi API.true
authTokenThe authentication token for Strapi if required.false
imageUrlThe URL of the image server. Required if using the media field typefalse
localeThe locale of the content if a multilanguage project.false
Last updated on