@balajmarius/svg2jsx

The svg2jsx transformer

Usage no npm install needed!

<script type="module">
  import balajmariusSvg2jsx from 'https://cdn.skypack.dev/@balajmarius/svg2jsx';
</script>

README

svg2jsx 🌜

Transform SVG into valid JSX

transform(svg, config)

Parameters

  • svg String The SVG string to be transformed
  • config Map
    • type functional | class The type of the resulting component
    • jsxSingleQuote Boolean Either double or single quotes in JSX attributes

Returns

Promise<String> JSX string