How to use the @storybook/addon-actions.actions 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 nordnet / ui / src / Molecules / Input / Text / Text.stories.tsx View on Github external
import React from 'react';
import { actions } from '@storybook/addon-actions';
import { Input, Icon, Flexbox, Button } from '../../..';
import { Display } from '../../../common/Display';

// A bit laggy for now, let's optimize later
const handlers = actions(
  'onBlur',
  'onClick',
  'onFocus',
  'onKeyDown',
  'onKeyUp',
  'onKeyPress',
  'onChange',
);

export default {
  title: 'Molecules | Input / Text',
  parameters: {
    component: Input.Text,
  },
};
github origen-chat / api / projects / web / src / stories / Button.stories.tsx View on Github external
// @ts-ignore
import { actions } from '@storybook/addon-actions';
import { select, text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import React from 'react';

import Button from '../components/Button';

const events = actions(
  'onClick',
  'onPointerDown',
  'onPointerUp',
  'onPointerOver',
  'onPointerLeave',
);

storiesOf(Button.name, module).add('contained', () => (
github nhn / toast-ui.react-grid / stories / index.stories.js View on Github external
stories.add('Events', () => {
  const eventsFromObject = actions('onClick', 'onDblclick', 'onMousedown');

  return ;
});
github ulaval / modul-components / src / components / button / button.stories.ts View on Github external
.add('default', () => ({
        props: {
            text: {
                default: text('Text', 'A Button')
            }
        },
        methods: actions(
            'click',
            'focus',
            'blur'
        ),
        template: '{{ text }}'
    }))
    .add('disabled', () => ({
github storybookjs / storybook / examples / preact-kitchen-sink / src / stories / addon-actions.stories.js View on Github external
export const multipleActions = () => (
  <button>(Double) click me to log the action</button>
);
github storybookjs / storybook / examples / official-storybook / stories / addon-actions.stories.js View on Github external
export const multipleActionsConfig = () =&gt; (
  <button>
    Moving away from this story will persist the action logger
  </button>
);
github nordnet / ui / src / Molecules / Input / Number / Number.stories.tsx View on Github external
import React from 'react';
import { storiesOf } from '@storybook/react';
import { actions, action } from '@storybook/addon-actions';
import { Input, FormField } from '../../..';
import { Display } from '../../../common/Display';

const handlers = actions(
  'onBlur',
  'onClick',
  'onFocus',
  'onKeyDown',
  'onKeyUp',
  'onKeyPress',
  'onChange',
  'onStepUp',
  'onStepDown',
);

storiesOf('Molecules | Input / Number', module)
  .add('Default', () =&gt; (