Built-in Templates
No need to craft a component from scratch just to use Takumi.
Takumi comes with built-in templates for common use cases. It's available in JSX format, you can pass it to the fromJsx
function to convert it to a Takumi node.
The reason to use JSX is because it allows more people to contribute to the templates, and another benefit is you can take it to other usages like satori.
Installation
npm i @takumi-rs/template
Usage
Just treat it as a normal React component.
import DocsTemplateV1 from "@takumi-rs/template/docs-template-v1";
import { ImageResponse } from "@takumi-rs/image-response";
export function GET() {
return new ImageResponse(<DocsTemplateV1 />, {
width: 1200,
height: 630,
format: "webp",
});
}
You can find all the templates in the takumi-template
folder.
We need your help to improve and create more templates! Please feel free to submit PRs to add more templates.