| Crates.io | svg2svelte |
| lib.rs | svg2svelte |
| version | 0.3.0 |
| created_at | 2022-08-24 00:51:44.558032+00 |
| updated_at | 2025-06-09 13:39:03.168844+00 |
| description | Easily turn an SVG file into a Svelte component, Rewritten in Rust. |
| homepage | |
| repository | https://github.com/derektata/svg2svelte-rs |
| max_upload_size | |
| id | 651422 |
| size | 145,555 |
Easily turn an SVG file into a Svelte component, Rewritten in Rust.
svg2svelte parses the svg file's ids for bind: in the name and converts them into variables we can manipulate later on with an animation library (e.g. anime.js)
svgo will need to be installed globally.npm i -g svgo # npm
yarn global add svgo # yarn
pnpm add -g svgo # pnpm
git clone https://github.com/derektata/svg2svelte-rs
cd svg2svelte-rs
make
cargo install svg2svelte
USAGE:
svg2svelte [OPTIONS] [SVG_FILE]
ARGS:
<SVG_FILE> File to be processed
OPTIONS:
-h, --help Print help information
-t, --typescript Create a Typescript component
-v, --verbose Print the generated component to stdout
-V, --version Print version information
EXAMPLES:
svg2svelte ball.svg
svg2svelte -t ball.svg

The previous implementation I had written up in shell had issues running cross-platform and only worked on Linux, so I decided to start learning more Rust and this project was born.