atanasster / storybook-addon-decorator

A storybook sample addon to create a decorator

Home Page:https://atanasster.github.io/storybook-addon-decorator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

https://atanasster.github.io/storybook-addon-decorator

License:MIT License


Languages

Language:TypeScript 52.8%Language:JavaScript 40.6%Language:HTML 6.6%