mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
49 lines
963 B
TypeScript
49 lines
963 B
TypeScript
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
|
|
import Button from './Button.svelte';
|
|
|
|
// More on how to set up stories at: https://storybook.js.org/docs/7.0/svelte/writing-stories/introduction
|
|
const meta: Meta<Button> = {
|
|
title: 'Example/Button',
|
|
component: Button,
|
|
tags: ['docsPage'],
|
|
argTypes: {
|
|
backgroundColor: { control: 'color' },
|
|
size: {
|
|
control: { type: 'select' },
|
|
options: ['small', 'medium', 'large'],
|
|
},
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<Button>;
|
|
|
|
// More on writing stories with args: https://storybook.js.org/docs/7.0/svelte/writing-stories/args
|
|
export const Primary: Story = {
|
|
args: {
|
|
primary: true,
|
|
label: 'Button',
|
|
},
|
|
};
|
|
|
|
export const Secondary: Story = {
|
|
args: {
|
|
label: 'Button',
|
|
},
|
|
};
|
|
|
|
export const Large: Story = {
|
|
args: {
|
|
size: 'large',
|
|
label: 'Button',
|
|
},
|
|
};
|
|
|
|
export const Small: Story = {
|
|
args: {
|
|
size: 'small',
|
|
label: 'Button',
|
|
},
|
|
};
|