Copy as React Component is a Sketch plugin that allows you to generate a React components with a keyboard shortcut.
Installation
- Download and unzip
- Double-click the plugin.sketchplugin file
Instructions
- In Sketch, select the layers to copy
- Hit Option ⌥+Command ⌘+R or go to Plugins -> Copy as Copy Component
- A React component is now copied to your clipboard!
How does it work?
Copy as React Component uses the same output from Right-Click > Copy SVG Code, then transforms it into JSX and prettifies it with Prettier.
That’s pretty much it!
Roadmap
- Add props for fill & stroke colors
- Add an option to copy a full React.Component class