We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 503b718 + 9303907 commit 82d8f2bCopy full SHA for 82d8f2b
examples/Button.stories.svelte
@@ -2,6 +2,7 @@
2
import { defineMeta, type Args, type StoryContext } from '@storybook/addon-svelte-csf';
3
import { fn } from '@storybook/test';
4
5
+ import type { Snippet } from 'svelte';
6
import Button from './components/Button.svelte';
7
8
const onclickFn = fn().mockName('onclick');
@@ -15,6 +16,7 @@
15
16
tags: ['autodocs'],
17
args: {
18
onclick: onclickFn,
19
+ children: 'Click me' as any,
20
},
21
argTypes: {
22
backgroundColor: { control: 'color' },
@@ -30,7 +32,7 @@
30
32
</script>
31
33
34
{#snippet template(args: Args<typeof Story>, context: StoryContext<typeof Story>)}
- <Button {...args}>Click me</Button>
35
+ <Button {...args}>{args.children}</Button>
36
{/snippet}
37
38
<!-- Only use this sparingly as the main CTA. -->
0 commit comments