OGXOGX

Presets Overview

Ready-to-use templates for common use cases

Presets are pre-designed layouts that handle common OG image patterns. They accept props and return a fully styled image.

Available Presets

PresetDescription
DocsDocumentation sites with title, description, and branding
BlogBlog posts with author, date, and category
SocialGradient backgrounds with handle and branding
MinimalClean typography on solid backgrounds

Previews

Documentation

Docs Preset

Blog

Blog Preset

Social

Social Preset

Minimal

Minimal Preset

Basic Usage

import { fontRegistry, ogx } from '@ogxjs/core';

await fontRegistry.registerInterFromUrl([400, 700]);

const png = await ogx({
  preset: 'docs',
  title: 'My Page',
  // preset-specific options...
});

Common Options

All presets support these options:

OptionTypeDescription
colorScheme'dark' | 'light'Color theme
logostringLogo URL or base64
slotsobjectOverride header/footer

Custom Slots

Override default elements:

import { ogx, span } from '@ogxjs/core';

const png = await ogx({
  preset: 'docs',
  title: 'Custom Header',
  slots: {
    header: span('text-sm text-zinc-500', 'Custom Header'),
  },
});

On this page