0.0.2 • Published 11 months ago

solid-satori v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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.

0.0.2

11 months ago

0.0.1

11 months ago

0.0.0

11 months ago