How to use @storybook/react - 10 common examples

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 error on invalid usage (global)', () => {
    // $ExpectError
    clearDecorators(true);
    // $ExpectError
    clearDecorators(parameters);
  });
});
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
    clearDecorators(true);
    // $ExpectError
    clearDecorators(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 error on invalid usage (global)', () => {
    // $ExpectError
    clearDecorators(true);
    // $ExpectError
    clearDecorators(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 error on invalid usage (global)', () => {
    // $ExpectError
    clearDecorators(true);
    // $ExpectError
    clearDecorators(parameters);
  });
});
github algolia / react-instantsearch / test / regressions / tests.js View on Github external
function normalize(string) {
  return string.replace(/[ -/]/g, '_');
}

// Remove the GeoSearch stories from the
// tests because they are too brittle
const stories = require.context(
  '../../stories',
  true,
  /^((?!GeoSearch).)*\.stories\.js$/
);

// loadStories
stories.keys().forEach(filename => stories(filename));
const tests = getStorybook().reduce((acc, book) => {
  book.stories.forEach(story => {
    acc.push({
      suite: normalize(book.kind),
      name: normalize(story.name),
      case: story.render,
      context: {
        kind: book.kind,
        story: story.name,
      },
    });
  });

  return acc;
}, []);

let interval;
github influxdata / clockface / src / Components / IndexList / Documentation / IndexList.stories.tsx View on Github external
import {SquareButton} from '../../Button/Composed/SquareButton'
import {EmptyState} from '../../EmptyState'

// Types
import {IconFont, ComponentColor, Alignment, Sort} from '../../../Types'

// Notes
import IndexListReadme from './IndexList.md'
import IndexListHeaderReadme from './IndexListHeader.md'
import IndexListHeaderCellReadme from './IndexListHeaderCell.md'
import IndexListBodyReadme from './IndexListBody.md'
import IndexListRowReadme from './IndexListRow.md'
import IndexListRowCellReadme from './IndexListRowCell.md'
import IndexListExampleReadme from './IndexListExample.md'

const indexListStories = storiesOf(
  'Components|IndexList/Family',
  module
).addDecorator(withKnobs)

const indexListExampleStories = storiesOf(
  'Components|IndexList/Examples',
  module
).addDecorator(withKnobs)

indexListStories.add(
  'IndexList',
  () => {
    const indexListRef = createRef()

    const logRef = (): void => {
      /* eslint-disable */
github bbc / simorgh / src / app / containers / Brand / index.stories.jsx View on Github external
import React from 'react';
import { storiesOf } from '@storybook/react';
import { inputProvider } from '@bbc/psammead-storybook-helpers';
import { withKnobs } from '@storybook/addon-knobs';
import services from '#server/utilities/serviceConfigs';
import { ServiceContextProvider } from '#contexts/ServiceContext';
import BrandContainer from '.';

storiesOf('Containers|Brand', module)
  .addParameters({ chromatic: { disable: true } })
  .addDecorator(withKnobs)
  .add(
    'default',
    inputProvider({
      // eslint-disable-next-line react/prop-types
      componentFunction: ({ service }) => {
        // eslint-disable-next-line import/no-dynamic-require,global-require
        const serviceConfig = require(`../../lib/config/services/${service}`)
          .service;
        const configVariant = serviceConfig.default;

        return (
github mpaupulaire4 / bulma-styled-components / src / components / __stories__ / card.stories.js View on Github external
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Delete, Image, Content } from '../../elements/'
import { Card } from '../'

storiesOf('Components', module)
  .add('Card', () => {
    const Card1 = Card.extend`
      max-width: 500px;
    `
    return (
      <div>
        
          
            
              Header
            
            
              
            
          
          </div>