Skip to content

Commit

Permalink
provide alternative to document modern example
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Oct 31, 2024
1 parent f7007cd commit 104d5e0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/Button.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
type StoryContext,
} from '@storybook/addon-svelte-csf';
import { fn } from '@storybook/test';
import { createRawSnippet } from 'svelte';
import Button from './components/Button.svelte';
Expand All @@ -20,7 +19,6 @@
component: Button,
tags: ['autodocs'],
args: {
children: createRawSnippet(() => ({ render: () => 'Click me' })),
onclick: onclickFn,
},
argTypes: {
Expand All @@ -38,8 +36,8 @@
setTemplate(template);
</script>

{#snippet template({ children, ...args }: Args<typeof Story>, context: StoryContext<typeof Story>)}
<Button {...args}>{children}</Button>
{#snippet template(args: Args<typeof Story>, context: StoryContext<typeof Story>)}
<Button {...args}>{'Click me'}</Button>
{/snippet}

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

0 comments on commit 104d5e0

Please sign in to comment.