Skip to content

❇️ Utility tool for converting Adobe Illustrator exports into React components

License

Notifications You must be signed in to change notification settings

kasparnau/svg-to-jsx

Repository files navigation

SVG to JSX converter

⚡Lightweight CLI utility tool for converting Adobe Illustrator's .svg export files into formatted React .jsx components.

Motivation: I spent an hour building a tool to avoid spending 3 minutes per SVG doing it manually.

Important

This project only supports Adobe Illustrator's svg exports.

Usage

  Usage: svg-to-jsx [options] [command]
  
  ┌────── svg-to-jsx ──────┐
  │ Convert .svg --> .jsx  │
  └────────────────────────┘
  
  Options:
    -V, --version              output the version number
    -h, --help                 display help for command
  
  Commands:
    convert [options] <input>  Convert Illustrator .svg to React component
    help [command]             display help for command

✨ Features

  • ⚡️ Command line interface - Commander
  • 🍿 Colored UI - Chalk
  • ✨ Unit testing - Vitest
  • 💾 Save to Clipboard or File

🖥️ How It Works

  1. Deconstruct the raw SVG file into individual objects using RegEx
  2. Build a React component out of the deconstructed SVG objects
  3. Format the new React component using Prettier
  4. ✨ Your SVG is ready to be used within your React app

✍🏻 Author

Made with ❤️ by Kaspar

About

❇️ Utility tool for converting Adobe Illustrator exports into React components

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published