Skip to content

Commit 06dee29

Browse files
authored
Pass children to button
1 parent a5d6cb6 commit 06dee29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/Button.stories.svelte

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
} from '@storybook/addon-svelte-csf';
88
import { fn } from '@storybook/test';
99
10+
import type { Snippet } from 'svelte'
1011
import Button from './components/Button.svelte';
1112
1213
const onclickFn = fn().mockName('onclick');
@@ -20,6 +21,7 @@
2021
tags: ['autodocs'],
2122
args: {
2223
onclick: onclickFn,
24+
children: 'Click me' as unknown as Snippet<[]>
2325
},
2426
argTypes: {
2527
backgroundColor: { control: 'color' },
@@ -37,7 +39,7 @@
3739
</script>
3840

3941
{#snippet template(args: Args<typeof Story>, context: StoryContext<typeof Story>)}
40-
<Button {...args}>{'Click me'}</Button>
42+
<Button {...args}>{args.children}</Button>
4143
{/snippet}
4244

4345
<!-- Only use this sparingly as the main CTA. -->

0 commit comments

Comments
 (0)