wix-style-react
includes a generator for scaffolding new components.
Run generator in root folder of the project:
npm run generate
You will be asked for component name (which must be in PascalCase
) and optional description.
Generator will:
- create files according to structure defined in Component Structure document
- add necessary
export
s to index file, testkits and stories index
Generator will create a sample .story.js
. Read story.js usage document for details.
By default documentation will be shown under Component
category. To change it modify category
value in src/YourNewComponent/test/storySettings.js
.
Make sure to re-arrange the Stories index file as needed. The order of require
s in that file is reflected in rendered storybook sidebar.