mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 05:51:21 +08:00
24 lines
582 B
Plaintext
24 lines
582 B
Plaintext
```md
|
|
<!-- YourComponent.stories.mdx -->
|
|
|
|
import { Meta, Story } from '@storybook/addon-docs';
|
|
|
|
import YourComponent from './YourComponent.svelte';
|
|
|
|
<!--👇 The title prop determines where your story goes in the story list -->
|
|
|
|
<Meta title="YourComponent" component={YourComponent} />
|
|
|
|
<!--👇 We create a “template” of how args map to rendering -->
|
|
export const Template = (args) => ({
|
|
Component: YourComponent,
|
|
props: args,
|
|
});
|
|
|
|
<!-- 👇 The args you need here will depend on your component -->
|
|
<Story
|
|
name="FirstStory"
|
|
args={{}}>
|
|
{Template.bind({})}
|
|
</Story>
|
|
``` |