Quick Start
Get Takumi running in minutes with the high-level ImageResponse API.
Takumi is a high-performance image renderer in Rust, featuring JSX support and portable runtimes.
This guide will get you up and running with the high-level ImageResponse API in just a few steps.
Try Playground
Run Takumi instantly in the browser.
Rust Crate Docs
Browse low-level Rust APIs on docs.rs.
1. Install
npm i @takumi-rs/image-response@beta2. Return an ImageResponse
ImageResponse extends the standard Response, so you can use it in any environment you want.
import { } from "@takumi-rs/image-response";
export function () {
return new (
< ="w-full h-full flex items-center justify-center bg-white">
< ="text-4xl font-bold">Hello Takumi 👋😁</>
</>,
{
: 1200,
: 630,
: "webp",
: "twemoji", // Available since 1.0.0-beta.3
: {
"Cache-Control": "public, max-age=3600",
},
},
);
}Internally, Takumi will tries to load the native bindings for your platform. If it fails, it will fallback to the WebAssembly version, which is slightly slower but works everywhere.
Templates
Need a fast starting point? Use built-in Templates from the registry:
npx shadcn@latest add https://takumi.kane.tw/templates/registry/docs-template.jsonContinue
Edit on GitHub
Last updated on