Installation
$ pnpm dlx shadcn@latest add @ogimagecn/photo
Usage
import { ImageResponse } from "next/og";
import { Photo } from "@/components/og/photo";
export function GET() {
return new ImageResponse(
<Photo
image="https://images.unsplash.com/photo-1469474968028-56623f02e42e"
label="Travel"
title="Chasing light across the northern coast"
brand="ogimagecn"
/>,
{ width: 1200, height: 630 }
);
}API Reference
Photo
| Prop | Type |
|---|---|
image | string |
label | string |
title | string |
brand | string |
logo | string |