How to use the @storybook/riot.compileNow function in @storybook/riot

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 / examples / riot-kitchen-sink / src / stories / addon-actions.stories.js View on Github external
import { mount, compileNow } from '@storybook/riot';
import { action } from '@storybook/addon-actions';
import ButtonRaw from './Button.txt';

compileNow(ButtonRaw);

export default {
  title: 'Addon/Actions',
};

export const actionOnly = () =>
  mount('my-button', {
    handleClick: action('button-click'),
    content: 'Click me to log the action',
  });

actionOnly.story = {
  name: 'Action only',
};

export const multipleActions = () =>
github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / addon-links.stories.js View on Github external
import { mount, compileNow } from '@storybook/riot';
import { linkTo } from '@storybook/addon-links';
import ButtonRaw from './Button.txt';

compileNow(ButtonRaw);

export default {
  title: 'Addon/Links',
};

export const goToWelcome = () =>
  mount('my-button', {
    rounded: true,
    content: 'This button links to Welcome',
    value: 'with a parameter',
    handleClick: linkTo('Welcome', 'Welcome'),
  });

goToWelcome.story = {
  name: 'Go to welcome',
};

@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