0.8.0 • Published 4 years ago
docs-examples v0.8.0
examples
Tools to work with .examples
files for React components.
Local Development
As you develop, you can run an application that displays component examples, documented via a .examples.js
file in the __examples__
directory for each component.
From the root of the rock-kit
repo:
- Run
yarn
- Run
yarn dev:examples
- http://localhost:9090 should open automatically in your browser
Sketch Asset Generation
Sketch assets for each component can be generated from the component examples that are displayed in the examples app.
In order to import the components into Sketch, you'll need to first install the asketch2sketch.sketchplugin
by downloading html-sketchapp and copying the asketch2sketch.sketchplugin
file into your Sketch Plugins
directory.
Then to generate the Sketch assets:
- Run
yarn start:examples
to spin up the examples app on localhost:9001 - Run
yarn generate:sketch
to generate astories.asketch.json
file. - Once in Sketch, open the "Plugins" menu, select "From Almost Sketch to Sketch", and select the
packages/__examples__/stories.asketch.json
file.