renderer returns a string, OGify parses it with satori-html before passing the result to Satori. This is the HTML string path of the rendering pipeline.
JSX templates (returning
ReactNode) skip this step entirely — the element tree goes
directly to Satori. See Custom Templates for the
recommended JSX approach.How It Works
In code (renderTemplate):
class → tw Mapping
satori-html converts standard HTML class attributes into Satori’s experimental tw prop. This lets you use Tailwind-like utility classes in HTML strings:
satori-html step):
Inline Styles
Use thestyle attribute for CSS properties not covered by utility classes:
When to Use HTML Strings
Good fit
Good fit
- Migrating existing HTML-based OG templates
- Simple layouts without conditional rendering
- Prototyping with familiar HTML syntax
Prefer JSX instead
Prefer JSX instead
- Conditional blocks (
{showBadge ? ... : null}) - Component composition and reuse
- Type-safe props and IDE autocomplete
- Using
htmlSnippetfor inline styled text
Limitations
For inline styled words inside text (bold highlights, opacity variants), usehtmlSnippet in JSX templates instead of raw HTML in strings.
Async HTML Renderers
HTML string renderers supportasync — useful when fetching data before building markup: