Skip to content
TrademarkTrademark
Docs
Utils

OG images

Updated: November 12, 2026
View on GitHub

When someone shares a link, the network shows the page's Open Graph image. createOgImageRoute draws that image for every page: 1200 × 630, dark, with the page's title in your heading font, an eyebrow above it, your domain below, and your mascot beside it, looking at the title. You describe your product once, in a skin, and every page gets its own card.

Route file

Meta.generate already points a page without its own image at /api/og/generate?title=…, so once the route exists, every page has a card. The route needs the Node.js runtime (the default) when the skin reads fonts from disk.

What a card says

The route reads the query string:

Parameter
What it does
titleThe headline. Words in *asterisks* are drawn in the brand color, in emphasisFont when the skin has one.
eyebrowA short label above the title: the section, a date, a place. section works too.
descriptionOne line under the title.
moodThe mascot's expression: happy, surprised, wink and the other Mascot moods.
layoutpage (the default), hero for a launch or a home page, or photo.
imageA photo for the card, from your own origin or a host in imageHosts. A card with an image uses the photo layout.
vIgnored by the route. Change it to give a card a new URL, since networks cache images by URL.

Build the URL with ogImageUrl:

Skin

Option
What it does
nameThe product's name, drawn as the wordmark and, faintly, behind the mascot.
domainShown at the bottom of every card.
brand, accentA scheme name (emerald, violet, …) or a CSS color. The brand lights the mascot and colors the eyebrow and emphasis; the accent adds a smaller glow.
backgroundThe ground. Near-black by default.
markA small symbol before the name: SVG markup, or an image path or URL.
logoA full logo in place of the wordmark.
mascotA look, with the same options as Mascot and an accessory as SVG markup or JSX, or { svg } for your own drawing in a 200 × 200 box. false leaves it out.
fontsTTF, OTF or WOFF files (not WOFF2), each from data, a path read from disk, or a google family fetched once per server. If a font can't be loaded, the card still draws in the fallback face.
headingFont, bodyFont, monoFont, emphasisFontWhich family from fonts each role uses.
moodThe mascot's expression when a card doesn't ask for one.
imageHostsHosts image= may load from, besides your own origin.

Fonts from disk are the safest choice: a card renders on the first crawl of a page, and a Google Fonts outage would otherwise draw it in the fallback face.

Caching

Cards are served with Cache-Control: public, max-age=31536000, immutable, so a CDN draws each one once. When you change the skin, change v in your URLs.

mascotSvg

The card draws your mascot with mascotSvg, which returns the mascot as a standalone SVG string: the same look options as Mascot, one still expression, every color written out. Use it anywhere React can't animate, such as emails and favicons.

Scheme names such as brand need a color through schemes, since there is no CSS to read them from. Kawaii moods draw their base mood, with blush where they have it.

Edit this page on GitHub