render React components to Sketch ⚛️💎
Permalink
Failed to load latest commit information.
.github Create ISSUE_TEMPLATE.md Mar 22, 2017
__tests__ support rendering into wrapped object (#379) Sep 18, 2018
docs add percentage values to layout styles docs (#378) Sep 18, 2018
examples Create nwb.config.js for react-primitives example (#365) Sep 18, 2018
flow-typed Enable flow on all src files May 23, 2018
src support rendering into wrapped object (#379) Sep 18, 2018
template support rendering into wrapped object (#379) Sep 18, 2018
.babelrc e2e tests (#346) May 31, 2018
.bookignore update bookignore Apr 5, 2017
.editorconfig Add Editor configuration files (#179) Sep 18, 2017
.eslintignore update to skpm@1.0 (#203) Nov 27, 2017
.eslintrc support rendering into wrapped object (#379) Sep 18, 2018
.flowconfig cleanup and bump dev dependencies (#314) May 4, 2018
.gitignore Only apps should have lockfiles. Jun 14, 2017
.jestrc.json e2e tests (#346) May 31, 2018
.npmignore remove yarn.lock files Apr 24, 2017
.npmrc Overhaul layout calculation (css-layout -> yoga-layout) (#188) Oct 10, 2017
.travis.yml support rendering into wrapped object (#379) Sep 18, 2018
CHANGELOG.md version 2.1.0 (#381) Sep 18, 2018
CODE_OF_CONDUCT.md support rendering into wrapped object (#379) Sep 18, 2018
CONTRIBUTING.md support rendering into wrapped object (#379) Sep 18, 2018
LICENSE Updated year (#267) Mar 23, 2018
README.md support rendering into wrapped object (#379) Sep 18, 2018
SUMMARY.md First pass docs & add gitbook Dec 11, 2016
book.json s/jongold/airbnb :) Mar 22, 2017
package.json version 2.1.0 (#381) Sep 18, 2018
prettier.config.js support rendering into wrapped object (#379) Sep 18, 2018

README.md

This project is currently in beta and APIs are subject to change.

react-sketchapp
render React components to Sketch; tailor-made for design systems

Quick-start 🏃‍

First, make sure you have installed Sketch version 43+, & a recent npm.

Open a new Sketch file, then in a terminal:

git clone https://github.com/airbnb/react-sketchapp.git
cd react-sketchapp/examples/basic-setup && npm install

npm run render

Next, check out some more examples!

readme-intro

npm Sketch.app Travis Gitter

Why?!

Managing the assets of design systems in Sketch is complex, error-prone and time consuming. Sketch is scriptable, but the API often changes. React provides the perfect wrapper to build reusable documents in a way already familiar to JavaScript developers.

What does the code look like?

import * as React from 'react';
import { render, Text, Artboard } from 'react-sketchapp';

const App = props => (
  <Artboard>
    <Text style={{ fontFamily: 'Comic Sans MS', color: 'hotPink' }}>{props.message}</Text>
  </Artboard>
);

export default context => {
  render(<App message="Hello world!" />, context.document.currentPage());
};

What can I do with it?

  • Manage design systems— react-sketchapp was built for Airbnb’s design system; this is the easiest way to manage Sketch assets in a large design system
  • Use real components for designs— Implement your designs in code as React components and render them into Sketch
  • Design with real data— Designing with data is important but challenging; react-sketchapp makes it simple to fetch and incorporate real data into your Sketch files
  • Build new tools on top of Sketch— the easiest way to use Sketch as a canvas for custom design tooling

Found a novel use? We'd love to hear about it!

Read more about why we built it

Documentation