mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
37 lines
643 B
Plaintext
37 lines
643 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
|
|
import Button from './Button.svelte';
|
|
|
|
//👇This default export determines where your story goes in the story list
|
|
const meta = {
|
|
component: Button,
|
|
} satisfies Meta<typeof Button>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Primary: Story = {
|
|
args: {
|
|
backgroundColor: '#ff0',
|
|
label: 'Button',
|
|
},
|
|
};
|
|
|
|
export const Secondary: Story = {
|
|
args: {
|
|
...Primary.args,
|
|
label: '😄👍😍💯',
|
|
},
|
|
};
|
|
|
|
export const Tertiary: Story = {
|
|
args: {
|
|
...Primary.args,
|
|
label: '📚📕📈🤓',
|
|
},
|
|
};
|
|
```
|