Skip to content

atanasster/storybook-addon-decorator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

storybook-addon-decorator

A storybook sample addon to create a decorator

Installation

npm i -D storybook-addon-decorator

Configuration

in the preview.js (old config.js) file in your .storybook folder, configure and add the decorator

import { addDecorator } from '@storybook/react';
import { withDecorator } from '../dist';

addDecorator(withDecorator({
  items: [
    { 
      class: 'bx-class-1',
      label: 'Box Class 1'
    },
    { 
      class: 'bx-class-2',
      label: 'Box Class 2'
    },
    { 
      class: 'bx-class-3',
      label: 'Box Class 3'
    },
    { 
      class: 'bx-class-4',
      label: 'Box Class 4'
    },

  ],
  selected: 'Box Class 4'
}
));

About

A storybook sample addon to create a decorator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published