Skip to content
Gaudi

Search documentation

Search every page, heading and paragraph.

On this page

OgCard

Open Graph image template for next/og ImageResponse: category, title, subtitle, site name and an optional logo on a neutral light or dark card, built only from inline styles.

Post@gaudi/design-system/post/OgCard

Installation

pnpm add github:g-udi/design-system

Import from @gaudi/design-system. Load @gaudi/design-system/global.css once and add transpilePackages: ['@gaudi/design-system'] in Next.js.

import { OgCard } from '@gaudi/design-system/post/OgCard';

Usage

// app/api/og/route.jsimport { ImageResponse } from 'next/og';import { OgCard, ogImageSize } from '@gaudi/design-system/post/OgCard';
export function GET() { return new ImageResponse( <OgCard title='Notes on local-first software' subtitle='What syncing taught me.' category='Engineering' siteName='example.com' />, ogImageSize );}

Examples

Playground

Storybook

API

7 props

Accessibility

The card becomes an image, so the page's og:image:alt (or the alt of an img that shows it) must repeat the title. Both palettes keep AA contrast for every text role.