Enlightened library to convert HTML and CSS to SVG. Satori supports the JSX syntax, which makes it very straightforward to use. Satori will render the element into a 600×400 SVG, and return the SVG string. Under the hood, it handles layout calculation, font, typography and more, to generate a SVG that matches the exact same HTML and CSS in a browser. Satori only accepts JSX elements that are pure and stateless. You can use a subset of HTML elements (see section below), or custom React components, but React APIs such as useState, useEffect, dangerouslySetInnerHTML are not supported. Satori supports a limited subset of HTML and CSS features, due to its special use cases. In general, only these static and visible elements and properties that are implemented. Also, Satori does not guarantee that the SVG will 100% match the browser-rendered HTML output since Satori implements its own layout engine based on the SVG 1.1 spec.

Features

  • You can use <img> to embed images
  • Satori uses the same Flexbox layout engine as React Native
  • It supports a subset of the spec that covers most common CSS features
  • Satori currently supports three font formats: TTF, OTF and WOFF
  • Multiple fonts can be passed to Satori and used in fontFamily
  • To render custom images for specific graphemes, you can use graphemeImages option to map the grapheme to an image source

Project Samples

Project Activity

See All Activity >

License

Mozilla Public License 1.0 (MPL)

Follow Satori

Satori Web Site

Other Useful Business Software
$300 Free Credits to Build on Google Cloud Icon
$300 Free Credits to Build on Google Cloud

New to Google Cloud? Get $300 in credits to explore Compute Engine, BigQuery, Cloud Run, Gemini Enterprise Agent Platform, and more.

Start your next project with $300 in free Google Cloud credit. Spin up VMs, run containers, query petabytes in BigQuery, or build agents with Gemini Enterprise Agent Platform. Once your credits are used, keep building with 20+ always-free tier products including Compute Engine, Cloud Storage, GKE, and Cloud Run functions. No commitment required—just sign up and start building.
Claim $300 Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Satori!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript AI Image Generators, TypeScript Generative AI

Registered

2023-03-22