storybook/docs/snippets/common/storybook-addon-backgrounds-configure-backgrounds.ts.mdx
2023-05-25 21:04:33 +01:00

25 lines
520 B
Plaintext

```ts
// Button.stories.ts|tsx
// Replace your-framework with the name of your framework
import type { Meta } from '@storybook/your-framework';
import { Button } from './Button';
// To apply a set of backgrounds to all stories of Button:
const meta: Meta<typeof Button> = {
component: Button,
parameters: {
backgrounds: {
default: 'twitter',
values: [
{ name: 'twitter', value: '#00aced' },
{ name: 'facebook', value: '#3b5998' },
],
},
},
};
export default meta;
```