Render the spec with your components, and show it in an iframe that updates instantly after each edit.
One renderer, used everywhere: the builder preview, the published site and template pages all call the same SiteRenderer with a spec. That guarantees what the customer sees while editing is exactly what goes live.
components/SiteRenderer.tsx
import type { SiteSpec } from "@/lib/spec";
export default function SiteRenderer({ spec }: { spec: SiteSpec }) {
return (
<div style={{ ["--p" as string]: spec.brand.primary }} className="min-h-screen bg-[#05060a] text-white">
<section className="px-6 py-32 text-center">
<h1 className="text-6xl font-semibold">{spec.hero.title}</h1>
<p className="mt-4 text-white/70">{spec.hero.sub}</p>
<a href="#contact" className="mt-8 inline-block rounded-full bg-[var(--p)] px-6 py-3 font-medium text-black">{spec.hero.cta}</a>
</section>
{/* One small component per section type, e.g. a Faq component that lists s.items */}
{spec.sections.map((s, i) => (s.type === "faq" ? <Faq key={i} {...s} /> : null))}
</div>
);
}
This lesson comes with a Velour plan
Every Academy lesson, code sample and Claude Code prompt is included with Publish and Growth, along with everything in the builder.