mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 16:02:26 +08:00
42 lines
672 B
Plaintext
42 lines
672 B
Plaintext
```md
|
|
<!-- Badge.stories.mdx -->
|
|
|
|
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
|
|
import Badge from './Badge.svelte';
|
|
|
|
<Meta title="MDX/Badge" component={Badge} />
|
|
|
|
export const Template = (args) => ({
|
|
Component: Badge,
|
|
props: args,
|
|
});
|
|
|
|
<Canvas>
|
|
<Story
|
|
name="warning"
|
|
args={{
|
|
status: 'warning',
|
|
label: 'Warning',
|
|
}}>
|
|
{Template.bind({})}
|
|
</Story>
|
|
<Story
|
|
name="neutral"
|
|
args={{
|
|
status: 'neutral',
|
|
label: 'Neutral',
|
|
}}>
|
|
{Template.bind({})}
|
|
</Story>
|
|
<Story
|
|
name="error"
|
|
args={{
|
|
status: 'error',
|
|
label: 'Error',
|
|
}}>
|
|
{Template.bind({})}
|
|
</Story>
|
|
</Canvas>
|
|
```
|