mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
26 lines
500 B
Plaintext
26 lines
500 B
Plaintext
```md
|
|
<!-- Button.stories.mdx -->
|
|
|
|
import { Meta, Story } from '@storybook/addon-docs';
|
|
|
|
import { Button } from './Button';
|
|
|
|
<Meta title="Button" component={Button} />
|
|
|
|
<Story
|
|
name="Primary"
|
|
parameters={{
|
|
backgrounds: {
|
|
values: [
|
|
{ name: 'red', value: '#f00' },
|
|
{ name: 'green', value: '#0f0' },
|
|
{ name: 'blue', value: '#00f' },
|
|
],
|
|
},
|
|
}}
|
|
args={{
|
|
primary: true,
|
|
label: 'Button',
|
|
}}
|
|
render={() => ({ // Your implementation here })} />
|
|
``` |