mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:01:48 +08:00
30 lines
515 B
Plaintext
30 lines
515 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
|
|
const meta: Meta = {
|
|
title: 'Button',
|
|
component: 'demo-button',
|
|
};
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof Button>;
|
|
|
|
export const Primary: Story = {
|
|
args: {
|
|
primary: true,
|
|
label: 'Button',
|
|
},
|
|
parameters: {
|
|
backgrounds: {
|
|
values: [
|
|
{ name: 'red', value: '#f00' },
|
|
{ name: 'green', value: '#0f0' },
|
|
{ name: 'blue', value: '#00f' },
|
|
],
|
|
},
|
|
},
|
|
};
|
|
```
|