How to use the @storybook/addon-actions.action function in @storybook/addon-actions

To help you get started, we’ve selected a few @storybook/addon-actions 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 Volst / ui-components / src / feedback / notification / index.stories.tsx View on Github external
onClick: (n, dismiss) => {
      action('click')(n);
      dismiss();
    },
    dismissAfter: false,
github RocketChat / Rocket.Chat.Livechat / src / components / input / story.js View on Github external
storiesOf('Form', module).add('Input and Label, stack button - Error', () => c(
	<form>
		
			<label>alo</label>
			<input>{text}
			 Invalid field
		
		
			<button disabled="">{text}</button>
		
	</form>
));
github mstrlaw / nuxt-storybook / .storybook / config.js View on Github external
log() {
      action('link target')(this.to)
    },
  },
github AlbionaHoti / react_admin_dashboard / src / stories / index.js View on Github external
.add('with some emoji', () =&gt; (
    <button><span aria-label="so cool" role="img">😀 😎 👍 💯</span></button>
  ));
github storybookjs / storybook / examples / aurelia-kitchen-sink / src / stories / button.stories.ts View on Github external
.add('Aurelia - Template', function () {
    const buttonText = text('Button Text', 'Aurelia Rocks!');
    const buttonClick = action('Button Click');
    const state = {
      buttonText,
      buttonClick,
    };
    return {
      template: `<template></template>`,
      state,
    };
  })
  .add('Aurelia - Auto Generate', function () {
github rmariuzzo / react-new-window / stories / default.stories.js View on Github external
toggleOpened() {
    action(this.state.opened ? 'Closing the window' : 'Opening the window')()
    this.setState(prevState => ({ opened: !prevState.opened }))
  }
github OperationCode / front-end / components / Cards / ResourceCard / __stories__ / ResourceCard.stories.js View on Github external
.add('with long name', () =&gt; (
    
  ))
  .add('with zero up/downvotes', () =&gt; (