storybook/docs/snippets/common/addon-actions-action-function.ts.mdx
Kyle Gach 5a23de20cf Add Parameters API reference
- Add API references for all essential addons
- Consolidate related snippets
2024-01-08 12:59:49 -07:00

19 lines
430 B
Plaintext

```ts
// Button.stories.ts
// Replace your-framework with the name of your framework
import type { Meta } from '@storybook/your-framework';
import { action } from '@storybook/addon-actions';
import Button from './Button';
const meta: Meta<typeof Button> {
component: Button,
args: {
// 👇 Create an action that appears when the onClick event is fired
onClick: action('on-click'),
},
};
export default meta;
```