/sketch-copy-as-react-component

Generate a React components from Sketch with a keyboard shortcut

Primary LanguageJavaScriptMIT LicenseMIT

Copy as React Component - Sketch Plugin

Copy as React Component is a Sketch plugin that allows you to generate a React components with a keyboard shortcut.

Installation

  1. Download and unzip
  2. Double-click the plugin.sketchplugin file

Instructions

  1. In Sketch, select the layers to copy
  2. Hit Option ⌥+Command ⌘+R or go to Plugins -> Copy as Copy Component
  3. A React component is now copied to your clipboard!

How does it work?

demo

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