How to use the @storybook/react.addParameters function in @storybook/react

To help you get started, we’ve selected a few @storybook/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / @storybook / react_v4.x.x / flow_v0.104.x- / test_react_v4.x.x.js View on Github external
it('should error on invalid usage (global)', () => {
    // $ExpectError
    addParameters();
    // $ExpectError
    addParameters('');
  });
});
github flow-typed / flow-typed / definitions / npm / @storybook / react_v5.x.x / flow_v0.104.x- / test_react_v5.x.x.js View on Github external
it('should error on invalid usage (global)', () => {
    // $ExpectError
    addParameters();
    // $ExpectError
    addParameters('');
  });
});
github flow-typed / flow-typed / definitions / npm / @storybook / react_v5.x.x / flow_v0.104.x- / test_react_v5.x.x.js View on Github external
it('should validate on default usage (global)', () => {
    addParameters(parameters);
  });
github flow-typed / flow-typed / definitions / npm / @storybook / react_v4.x.x / flow_v0.104.x- / test_react_v4.x.x.js View on Github external
it('should validate on default usage (global)', () => {
    addParameters(parameters);
  });
github storybookjs / addon-development-kit / .storybook / stories.js View on Github external
import { storiesOf, addDecorator, addParameters } from '@storybook/react';
import addons, { makeDecorator } from '@storybook/addons';

import { withAdk, adkParams } from '../dev/withAdk';

/**
 * todo:
 * 1. Add themes via one global method from `config.js` with global decorator inside
 * 2. Set additional theme via addParameters (global/local)
 * 3. Select current theme via parameters (to override)
 * 4. Keep current theme in url
 *
 */

addParameters(adkParams({ themes: ['theme1', 'theme2'], currentTheme: 0 }));

storiesOf('Storybook Addon Development Kit', module)
  .addDecorator(withAdk({ mainColor: 'green' }))
  .add(
    'Stories',
    () => {
      console.log('Render Button 1');
      return (
        <div>
          <button>Button 1</button>
        </div>
      );
    },
    adkParams({ currentTheme: 1 })
  )
  .add(