storybook/docs/snippets/react/button-story-with-parameters.ts.mdx
2022-11-17 16:33:22 +01:00

28 lines
609 B
Plaintext

```tsx
// Button.stories.ts|tsx
import { Button } from './Button';
import type { Meta } from '@storybook/react';
const meta: Meta<typeof Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
//👇 Creates specific parameters for the story
parameters: {
backgrounds: {
values: [
{ name: 'red', value: '#f00' },
{ name: 'green', value: '#0f0' },
],
},
},
};
export default meta;
```