mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:52:07 +08:00
38 lines
699 B
Plaintext
38 lines
699 B
Plaintext
```md
|
|
<!-- Button.stories.mdx -->
|
|
|
|
import { Meta, Story } from '@storybook/addon-docs';
|
|
|
|
import { Button } from './button.component';
|
|
|
|
<Meta title="Components/Button" component={Button}/>
|
|
|
|
<!-- The render function is a framework specific construct to define how the story should render -->
|
|
|
|
<Story
|
|
name="Primary"
|
|
render={() => ({
|
|
props: {
|
|
backgroundColor: '#ff0',
|
|
label: 'Button',
|
|
},
|
|
})} />
|
|
|
|
<Story
|
|
name="Secondary"
|
|
render={() => ({
|
|
props: {
|
|
backgroundColor: '#ff0',
|
|
label: '😄👍😍💯',
|
|
},
|
|
})} />
|
|
|
|
<Story
|
|
name="Tertiary"
|
|
render={() => ({
|
|
props: {
|
|
backgroundColor: '#ff0',
|
|
label: '📚📕📈🤓',
|
|
},
|
|
})} />
|
|
``` |