@actuate-media/sections-react
v0.2.19
Published
Public React renderer for Actuate CMS page sections — the canonical PageSection[] contract — with a consumer-controlled renderer registry.
Readme
@actuate-media/sections-react
Public React renderer for Actuate CMS
page sections — the canonical PageSection[] contract — with a
consumer-controlled renderer registry.
npm install @actuate-media/sections-reactUsage
import { SectionList, registerSectionRenderer } from '@actuate-media/sections-react'
// Register renderers for your custom section types (built-ins are included)
registerSectionRenderer('my-hero', ({ section, ctx, options }) => (
<MyHero {...(section.content as MyHeroContent)} />
))
// Render a resolved page
<SectionList sections={page.sections} ctx={{ siteUrl }} />The same custom types can be made editable in the admin via
defineSectionTypes() + sections.types in actuate.config.ts, and rendered
in the editor canvas via AdminRoot's sectionRenderers prop.
Release notes
See CHANGELOG.md (shipped with the package) or the GitHub releases.
License
MIT
