Satori turns JSX describing HTML and CSS into SVG strings, with layout, fonts, and typography handled server-side. It suits Open Graph images, social cards, and similar programmatic graphics.
Overview
Satori accepts pure, stateless JSX elements and renders them into SVG at a chosen size, returning the markup as a string. You can describe UI with a subset of HTML elements, inline styles, or custom components, without relying on browser React APIs such as hooks or effects.
Under the hood it runs its own layout engine using Flexbox, Grid, and block layout for text, drawing on Taffy for much of CSS positioning and sizing. It implements a large but incomplete slice of CSS and HTML compared with real browsers, and does not guarantee pixel-perfect parity with browser output.
You may embed images via img or background-image, load fonts through options you pass in, and optionally use an experimental WebGL canvas path from a separate import. Converting the SVG to PNG is typically done with another tool such as Sharp and librsvg.
The library is aimed at server-side or edge image generation workflows, including Open Graph and social preview cards, and pairs with frameworks that generate such images at request time.
Key features
- JSX-to-SVG rendering
- Subset of HTML and CSS
- Flexbox, Grid, and block layout
- Custom font loading
- Embedded and background images
- Experimental WebGL canvas path
- Optional JSX runtime without React
- Object-based elements without JSX
Use cases
- Open Graph image generation
- Social preview cards
- Server-side UI snapshots as SVG
- Programmatic branded graphics