Sprucebot for React
Goals
- Translate vanilla components from Sprucebot Heartwood into React components for use in web.
Setup
- Follow the instructions for the workspace
- Add Storybook CLI tool globally:
yarn global @storybook/cli
Running Storybook locally
- From
packages/react-heartwood-components
, runyarn storybook
- If you need to load additional stylesheets, i.e. from
sprucebot-heartwood
, you can specify them in.env
asSTYLESHEETS
Adding stories
Any .js
file that ends with -story.js
will be automatically added to Storybook.
Usage in Skills
- Add the current prerelease version:
yarn add @sprucelabs/react-heartwood-components@8.x.x
- Import components:
import { Button } from '@sprucelabs/react-heartwood-components'
React Docgen
This project uses React Docgen via Storybook Info Addon to autogenerate documentation from Flow declarations and comments.
To add a description to a prop, write a comment above it:
type Props = {
/** This is the component's title */
title: string
}
This will add it to the description cell in the props table.
Contributing
TBD — This is currently a prerelease
Deploying Storybook as a static site
TBD