react-tas-components

1.8.46 • Public • Published

TAS React Components

Components for React JS applications.

Installation

npm install react-tas-components --save

Storybook

Start storybook

npm run dev

Started on http://localhost:9001/

Develop

Core components path - lib/, alias for import inner dependency components - components

For create component story you need create a file index.story.js in component root dir

Code style for components

See CODESTYLE

Code style for stories

Example:

import React from 'react';
import { action } from '@storybook/addon-actions';
import { createComponentStory } from 'stories';
 
import Example from './index';
 
const story = createComponentStory({ component: Example });
 
story.addWithDoc('Example', ({ props }) => (
  <Example {...props} onClick={action('onClick')} />
));

createComponentStory - creates the story object for component

Options:

  • component - component for story

Methods:

  • addWithDoc - creates the new option in component tab, arguments:
    • Option name (required)
    • Render function (required) - Render component preview, props will generate automatically with component documentation
    • Component - if you use not base component
    • Options:
      • defaultProps - default props for Knobs (Object)
      • ignoreProps - list of ignored props for documentation (Array)

Example component: Example

Other

Storybook JS documentation

Action addon documentation

Readme

Keywords

none

Package Sidebar

Install

npm i react-tas-components

Weekly Downloads

12

Version

1.8.46

License

ISC

Unpacked Size

1.34 MB

Total Files

456

Last publish

Collaborators

  • kbtas