stdout-design_

OG Image Generation

Generate social preview images with @stdout-design/core

@stdout-design/core/og provides createOgResponse the render bridge for OG images and the StandardOgTemplate component with your product's design tokens baked in.

The template uses the same design tokens as @stdout-design/web-ui: dark surface (#0a0a0b), indigo accent (#6366f1), and content-colored text. OG images match your product's look without a second design system for marketing assets.

Quick Start

import { createOgResponse } from "@stdout-design/core/og";
import { StandardOgTemplate } from "@stdout-design/core/og";

export async function GET() {
  return createOgResponse(
    <StandardOgTemplate
      title="Hello World"
      description="My first OG image"
      siteName="My App"
    />
  );
}

Props

PropTypeDefaultDescription
titlestringrequiredMain headline (auto-sizes for long text)
descriptionstring?Supporting text below the title
siteNamestring?Site name displayed in the footer

Options

createOgResponse accepts every option Takumi supports fonts, quality, lossless, stylesheets, devicePixelRatio, lang, images, keyframes plus OG-specific defaults:

OptionDefaultDescription
width1200OG standard width
height630OG standard height
format"webp"Best size/quality for social previews
devicePixelRatio2Retina-quality rendering
localeBCP-47 locale (auto-sets lang + RTL shaping)

Font URLs work directly no fetch → arrayBuffer() dance:

import { createOgResponse } from "@stdout-design/core/og";
import { StandardOgTemplate } from "@stdout-design/core/og";

createOgResponse(<StandardOgTemplate title="..." />, {
  fonts: ["https://cdn.example.com/Inter-Bold.woff2"],
});

Design

The default template uses the same tokens as @stdout-design/web-ui: dark surface (#0a0a0b), indigo accent (#6366f1), content text (#e4e4e7), and muted footer.

On this page