solid-satori
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

solid-satori

solid-satori

pnpm

Solid wrapper for Satori. Convert Solid components to SVG

Quick start

Install it:

npm i solid-satori
# or
yarn add solid-satori
# or
pnpm add solid-satori

Use it:

// routes/og.png.tsx
import { renderToSvg } from "solid-satori";

const svg: string = await renderToSvg(
  () => (
    <div>
      Hello World
    </div>
  ),
  {
    width: 1200,
    height: 630,
    fonts: [
      ...
    ],
  },
);

Converting to Image

If you are using Node you can use @resvg/resvg-js, for edge or browser you can use @resvg/resvg-wasm.

Readme

Keywords

Package Sidebar

Install

npm i solid-satori

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

6.47 kB

Total Files

8

Last publish

Collaborators

  • ryoid