fbredius/storybook

View on GitHub
docs/snippets/common/component-story-custom-params.mdx.mdx

Summary

Maintainability
Test Coverage
```md
<!-- Button.stories.mdx -->

import { Meta, Story } from '@storybook/addon-docs';

import { Button } from './Button';

<Meta title="Button" component={Button} />

export const Template = (args) =>({
  // 👈 Your template goes here
});

<Story
  name="Primary"
  parameters={{
    backgrounds: {
      values: [
        { name: 'red', value: '#f00' },
        { name: 'green', value: '#0f0' },
        { name: 'blue', value: '#00f' },
      ],
    },
  }}
  args={{
    primary: true,
    label: 'Button',
  }}>
  {Template.bind({})}
</Story>
```