How to use @storybook/riot - 10 common examples

To help you get started, we’ve selected a few @storybook/riot 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 storybookjs / storybook / lib / cli / generators / RIOT / template / stories / index.stories.js View on Github external
import { mount, storiesOf } from '@storybook/riot';
import { linkTo } from '@storybook/addon-links';

/* eslint-disable-next-line import/no-webpack-loader-syntax */
import MyButtonRaw from 'raw-loader!./MyButton.tag';
import './MyButton.tag';
import './Welcome.tag';

storiesOf('Welcome', module).add('to Storybook', () =>
  mount('welcome', { showApp: () => linkTo('Button') })
);

storiesOf('Button', module)
  .add('with text', () => ({
    tags: ['Hello Button'],
  }))
  .add('with scenario', () => ({
    tags: [{ content: MyButtonRaw, boundAs: 'MyButton' }],
    template: 'With scenario',
  }))
  .add('with some emoji', () => ({
    tags: ['😀 😎 👍 💯'],
  }));
github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / index.js View on Github external
import { mount, storiesOf } from '@storybook/riot';
import { linkTo } from '@storybook/addon-links';
import ButtonRaw from './Button.txt';
import './Welcome.tag';
import '../App.tag';

storiesOf('Welcome', module).add('Welcome', () =>
  mount('welcome', { goToButton: linkTo('Button') })
);

storiesOf('App', module).add('App', () => mount('app', {}));

storiesOf('Button', module)
  // Works if riot.component is called in the config.js in .storybook
  .add('rounded', () => ({
    tags: [{ boundAs: 'my-button', content: ButtonRaw }],
    template: 'A Button with rounded edges',
  }))
  .add('square', () => ({
    tags: [{ boundAs: 'my-button', content: ButtonRaw }],
    template: 'A Button with square edges',
  }));
github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / index.js View on Github external
import { mount, storiesOf } from '@storybook/riot';
import { linkTo } from '@storybook/addon-links';
import ButtonRaw from './Button.txt';
import './Welcome.tag';
import '../App.tag';

storiesOf('Welcome', module).add('Welcome', () =>
  mount('welcome', { goToButton: linkTo('Button') })
);

storiesOf('App', module).add('App', () => mount('app', {}));

storiesOf('Button', module)
  // Works if riot.component is called in the config.js in .storybook
  .add('rounded', () => ({
    tags: [{ boundAs: 'my-button', content: ButtonRaw }],
    template: 'A Button with rounded edges',
  }))
  .add('square', () => ({
    tags: [{ boundAs: 'my-button', content: ButtonRaw }],
    template: 'A Button with square edges',
  }));
github storybookjs / storybook / lib / cli / generators / RIOT / template / stories / index.stories.js View on Github external
import { mount, storiesOf } from '@storybook/riot';
import { linkTo } from '@storybook/addon-links';

/* eslint-disable-next-line import/no-webpack-loader-syntax */
import MyButtonRaw from 'raw-loader!./MyButton.tag';
import './MyButton.tag';
import './Welcome.tag';

storiesOf('Welcome', module).add('to Storybook', () =>
  mount('welcome', { showApp: () => linkTo('Button') })
);

storiesOf('Button', module)
  .add('with text', () => ({
    tags: ['Hello Button'],
  }))
  .add('with scenario', () => ({
    tags: [{ content: MyButtonRaw, boundAs: 'MyButton' }],
    template: 'With scenario',
  }))
  .add('with some emoji', () => ({
    tags: ['😀 😎 👍 💯'],
  }));
github storybookjs / storybook / lib / cli / generators / RIOT / template-csf / .storybook / config.js View on Github external
import { configure } from '@storybook/riot';

// automatically import all files ending in *.stories.js
configure(require.context('../stories', true, /\.stories\.js$/), module);
github storybookjs / storybook / examples / riot-kitchen-sink / .storybook / config.js View on Github external
import { load, addParameters } from '@storybook/riot';

addParameters({
  options: {
    hierarchyRootSeparator: /\|/,
  },
});

// require('../src/stories');
load(require.context('../src/stories', true, /\.stories\.js$/), module);
github storybookjs / storybook / lib / cli / generators / RIOT / template / stories / 0-Welcome.stories.js View on Github external
export const toStorybook = () => mount('welcome', { showApp: () => linkTo('Button') });
github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / story-code.stories.js View on Github external
  .add('built from the precompilation', () => mount('anothertest', {}), {
    notes: 'WARN, only works in lower case, never upper case with precompiled templates',
github storybookjs / storybook / lib / cli / generators / RIOT / template / stories / index.stories.js View on Github external
storiesOf('Welcome', module).add('to Storybook', () =>
  mount('welcome', { showApp: () => linkTo('Button') })
);
github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / index.js View on Github external
storiesOf('Welcome', module).add('Welcome', () =>
  mount('welcome', { goToButton: linkTo('Button') })
);

@storybook/riot

Storybook for riot.js: View riot snippets in isolation with Hot Reloading.

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis