npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-svgr

v0.2.0

Published

SVGR integration for n8n nodes

Downloads

165

Readme

n8n-nodes-svgr

This is an n8n community node that transforms SVG code into React components.

n8n is a fair-code licensed workflow automation platform.

✅ n8n Cloud Compatible

This node has no external dependencies and is fully compatible with both:

  • ✅ n8n Cloud
  • ✅ Self-hosted n8n instances

Features

  • Transform SVG code into React components
  • Basic Options: icon, dimensions, svgo, prettier, removeViewBox, addFillCurrentColor
  • Code Generation: typescript, jsxRuntime (classic/automatic), exportType (default/named)
  • Component Wrapping: ref (forwardRef), memo (React.memo)
  • Props Control: expandProps, svgProps, replaceAttrValues
  • Accessibility: titleProp, descProp (aria-labelledby, aria-describedby)
  • React Native: native mode with react-native-svg support

Documentation

Installation

n8n Cloud

  1. Go to Settings > Community Nodes
  2. Click Install
  3. Enter n8n-nodes-svgr
  4. Click Install

Self-Hosted n8n

Install via npm in your n8n installation directory:

npm install n8n-nodes-svgr

Or install through the n8n UI:

  1. Go to Settings > Community Nodes
  2. Click Install
  3. Enter n8n-nodes-svgr
  4. Click Install

From Source

  1. Clone this repository
  2. Install dependencies:
    pnpm install
  3. Build the node:
    pnpm run build
  4. Link to your n8n installation or copy dist/ to your n8n's node_modules/n8n-nodes-svgr/

Usage

  1. Add the SVGR node to your workflow
  2. Enter your SVG code in the SVG Code field
  3. Set the Component Name (default: SvgComponent)
  4. Configure options as needed (see Options Guide for details)
  5. Execute the node to get the transformed React component

Quick Options Reference

| Option | Default | Description | | ---------- | --------- | -------------------------------------- | | icon | true | Remove width/height for scalable icons | | typescript | false | Generate TypeScript code | | jsxRuntime | classic | JSX runtime (classic or automatic) | | ref | false | Wrap with forwardRef | | memo | false | Wrap with React.memo | | native | false | Generate React Native SVG code | | exportType | default | Export type (default or named) |

Example

Input (SVG Code):

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  <path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z"/>
</svg>

Output (reactCode):

import * as React from 'react';
const SvgComponent = (props) => (
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
		<path d="M12 2 2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z" />
	</svg>
);
export default SvgComponent;

Development

Setup

pnpm install

Development Mode

Start n8n with hot reload:

pnpm run dev

Build

pnpm run build

This compiles the TypeScript code to JavaScript. The node uses a custom SVG→JSX transformer with no external dependencies.

Lint

pnpm run lint
pnpm run lint:fix

Testing

Run unit tests:

pnpm test

Run tests in watch mode:

pnpm test:watch

Run tests with coverage:

pnpm test -- --coverage

Test your node in n8n:

pnpm run dev

Then test your node in n8n workflows at http://localhost:5678

Compatibility

| n8n Version | Compatibility | | ----------- | ------------- | | 1.0+ | ✅ Compatible | | n8n Cloud | ✅ Compatible |

No external dependencies required! This node uses a custom SVG→JSX transformer built specifically for n8n, making it fully compatible with n8n Cloud.

Technical Details

This node uses a custom-built SVG→JSX transformer that:

  • Converts HTML attributes to React JSX syntax (e.g., classclassName, stroke-widthstrokeWidth)
  • Handles style attributes by converting them to React style objects
  • Supports icon mode (removes dimensions for scalable icons)
  • Generates TypeScript-compatible code when enabled
  • Formats output with basic prettification
  • Includes built-in SVGO optimization (27 plugins for SVG cleanup)

The transformer is built without external dependencies, making it fully compatible with n8n Cloud restrictions.

Resources

Version History

0.1.0

  • Initial release
  • Transform SVG to React components
  • Configurable options (Icon, TypeScript, Prettier, Dimensions)
  • Self-hosted n8n support

License

MIT

Author

SeonHyungjo

Contributing

Issues and pull requests are welcome! Please feel free to contribute.

Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue if your problem isn't already listed
  3. Visit the n8n Community Forum