mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
23 lines
541 B
Plaintext
23 lines
541 B
Plaintext
```html
|
|
<!-- Button.stories.svelte -->
|
|
|
|
<script>
|
|
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
|
|
|
|
import Button from './Button.svelte';
|
|
</script>
|
|
|
|
<Meta title="Button" component={Button} argTypes={{ label: { control: 'text' }, primary: { control:
|
|
'boolean' }, }} />
|
|
|
|
<!--👇 We create a “template” of how args map to rendering -->
|
|
|
|
<template let:args>
|
|
<button {...args} />
|
|
</template>
|
|
|
|
<!-- 👇 Each story then reuses that template -->
|
|
|
|
<Story name='Primary' args={{ primary: true, label: 'Button' }} />
|
|
```
|