@compai/jsx-to-png
v0.0.42
Published
Turn a JSX string with the `sx` prop into a png image.
Downloads
50
Readme
@compai/jsx-to-png
Turn a JSX string with the sx
prop into a png image.
Installation
yarn add @compai/jsx-to-png
Usage
import fs from 'fs'
import { render } from '@compai/jsx-to-png'
const JSX = `
<h1
sx={{
backgroundColor: 'tomato'
}}
>
Hello, world!
</h1>
`
(async () => {
const png = await render(JSX)
fs.writeFileSync('test.png', png)
})()
Related
OSS by Components AI.