Skip to content

Commit 82d8f2b

Browse files
authored
Merge pull request #268 from SteveALee/next
In Button example, fix `children` arg not being controllable
2 parents 503b718 + 9303907 commit 82d8f2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/Button.stories.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { defineMeta, type Args, type StoryContext } from '@storybook/addon-svelte-csf';
33
import { fn } from '@storybook/test';
44
5+
import type { Snippet } from 'svelte';
56
import Button from './components/Button.svelte';
67
78
const onclickFn = fn().mockName('onclick');
@@ -15,6 +16,7 @@
1516
tags: ['autodocs'],
1617
args: {
1718
onclick: onclickFn,
19+
children: 'Click me' as any,
1820
},
1921
argTypes: {
2022
backgroundColor: { control: 'color' },
@@ -30,7 +32,7 @@
3032
</script>
3133

3234
{#snippet template(args: Args<typeof Story>, context: StoryContext<typeof Story>)}
33-
<Button {...args}>Click me</Button>
35+
<Button {...args}>{args.children}</Button>
3436
{/snippet}
3537

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

0 commit comments

Comments
 (0)