react-sketchapp

render React components to Sketch ⚛️?

Github stars Tracking Chart

Quick-start ?‍

First, make sure you have installed Sketch version 50+, & 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

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

Main metrics

Overview
Name With Ownerairbnb/react-sketchapp
Primary LanguageTypeScript
Program languageJavaScript (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2017-04-21 18:27:39
Pushed At2024-05-14 11:10:52
Last Commit At2021-03-30 09:57:30
Release Count55
Last Release Namev3.2.2 (Posted on )
First Release Namev0.0.0 (Posted on )
用户参与
Stargazers Count14.9k
Watchers Count404
Fork Count817
Commits Count780
Has Issues Enabled
Issues Count299
Issue Open Count29
Pull Requests Count190
Pull Requests Open Count6
Pull Requests Close Count32
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private