storybook/docs/snippets/common/component-story-custom-params.mdx.mdx

32 lines
648 B
Plaintext

```md
<!-- Button.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { Button } from './Button';
<Meta title="Button" component={Button} />
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
import { Button } from './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 })} />
```