ChatGPT Codex is OpenAI's AI coding agent, built into ChatGPT. It reads and writes files, runs terminal commands, and can scaffold a full project from a single natural language description. When you give it a Moon template, it uses the design as a fixed reference and generates all your product code around it — rather than inventing its own layout from scratch.
Step 1: copy a Moon template
Browse the Moon gallery and open the section you want to use. Click "Copy code." The full self-contained HTML is now on your clipboard — no framework, no external dependencies, nothing to install before you paste it.
Step 2: open ChatGPT Codex and paste the template into your prompt
Start a new Codex session and paste the Moon template alongside your product description. A prompt structure that works well looks like this:
Build a landing page for a B2B analytics SaaS for operations teams. Use the hero section below as the top of the page. Replace the headline with "See every workflow, all in one place." Keep all the design from the template exactly as provided — the typography, the spacing, the animations. Add a features section below the hero with three columns.
[paste Moon template here]
Codex treats the pasted HTML as a hard design constraint and builds everything else in the session consistent with that baseline.
Step 3: write to a file for multi-session projects
For a project that spans more than one session, ask Codex to write the Moon template to a file in your project on the first run: "Save the hero section HTML to reference/hero.html and build the homepage component from it." In later sessions, you can point Codex to the saved file instead of pasting the template again.
Step 4: lock the design before adding backend logic
Once Codex has rendered the first version, verify the Moon template design is intact before adding routes, data models, or authentication. If any styles have drifted, send a targeted correction before continuing: "Restore the hero section to match the design in reference/hero.html exactly." Then proceed to build out your product logic.
Converting the template to React or Tailwind
Moon templates use inline styles for maximum portability. If your project uses React and Tailwind, include "convert all inline styles to Tailwind classes and wrap in a React component" in your initial instruction. Codex handles the conversion accurately and flags values without a direct Tailwind equivalent so you can add them to your config.