storybook/docs/snippets/svelte/button-story-click-handler-simplificated.native-format.mdx
2022-01-06 20:45:26 +00:00

27 lines
550 B
Plaintext

```html
<!-- Button.stories.svelte -->
<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Button from './Button.svelte';
</script>
<!--
See https://storybook.js.org/docs/svelte/essentials/actions#action-argtype-annotation
to learn how to set up argTypes for actions
-->
<Meta
title="Button"
component={Button}
argTypes={{
onClick: { action: "onClick" },
}}
/>
<Template let:args>
<Button {...args} on:click={args.onClick} />
</Template>
<Story name="Text" args={{ label: 'Hello' }}/>
```