0.1.2 • Published 2 years ago
svgxr v0.1.2
svgxr
Convert SVGs to React components
How to use?
- To install run:
npm i -g svgxr- Once the package is installed globally, run:
svgxr YourFile.svgThis command will create a React component with the same name as the input file.
Alternatively, you can also run:
npx svgxr YourFile.svgOptions
You can pass your own React component name by using the o flag:
svgxr YourFile.svg -o HelloThis will create a React component file with the name Hello.jsx.
To generate a TypeScript component, use the t flag:
svgxr YourFile.svg -o Hello -t tsThis will create a React component file with the name Hello.tsx.