mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-03 05:04:51 +08:00
27 lines
550 B
Plaintext
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' }}/>
|
|
``` |