1.0.0 • Published 4 years ago

@ecrowjs/storybook v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Storybook configurations for eCrowJS component libraries. This is not a fork of the Storybook repository; instead, it's a package containing common storybook configurations, addons, and CLI for visually testing most eCrowJS component libraries. Possibly more properly defined as a Storybook "wrapper".

To learn more about Storybook, check out their website or GitHub page.

Installation

eCrowJS Storybook can be installed as an npm package itself.

# Install with NPM
npm install @ecrowjs/storybook --save-dev
# Install with Yarn
yarn add @ecrowjs/storybook --dev

Usage

eCrowJS Storybook will include files in your project's src folder that match the expression below:

// Regular Expression
.chapter.tsx$
// Glob
*.chapter.tsx

In a chapter file, you can include the Story function from @ecrowjs/storybook package to add it to the application:

// ReactJS Example
import Story from '@ecrowjs/storybook';
import React from 'react';
import MyComponent from './MyComponent';

Story('Name of Story').add('MyComponentChapter', () => {
  return <MyComponent />;
});

Finally, to run the storybook application in development mode, you can use the command:

$ ecrowjs-storybook

That's all there is to it.