buster/web/src/components/ui/switch/AppSwitch.stories.tsx

47 lines
841 B
TypeScript
Raw Normal View History

2025-02-22 05:13:15 +08:00
import type { Meta, StoryObj } from '@storybook/react';
import { Switch } from './AppSwitch';
const meta: Meta<typeof Switch> = {
title: 'Base/Switch',
component: Switch,
2025-02-22 05:29:15 +08:00
tags: ['autodocs'],
2025-02-22 05:13:15 +08:00
argTypes: {
className: { control: 'text' },
defaultChecked: { control: 'boolean' },
disabled: { control: 'boolean' },
checked: { control: 'boolean' }
}
};
export default meta;
type Story = StoryObj<typeof Switch>;
export const Default: Story = {
args: {}
};
export const Checked: Story = {
args: {
defaultChecked: true
}
};
export const Disabled: Story = {
args: {
disabled: true
}
};
export const DisabledChecked: Story = {
args: {
disabled: true,
defaultChecked: true
}
};
export const WithCustomClassName: Story = {
args: {
2025-02-22 05:29:15 +08:00
className: 'data-[state=checked]:bg-green-500'
2025-02-22 05:13:15 +08:00
}
};