TakumiTakumi

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.

1. Install

npm i @takumi-rs/image-response@beta

2. 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.json

Continue

Edit on GitHub

Last updated on

On this page