mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:01:48 +08:00
28 lines
426 B
Plaintext
28 lines
426 B
Plaintext
```js
|
|
// Button.stories.js
|
|
|
|
export default {
|
|
title: 'Button',
|
|
component: 'custom-button',
|
|
//👇 Enables auto-generated documentation for the component story
|
|
tags: ['docsPage'],
|
|
argTypes: {
|
|
backgroundColor: { control: 'color' },
|
|
},
|
|
};
|
|
|
|
export const Primary = {
|
|
args: {
|
|
primary: true,
|
|
label: 'Button',
|
|
},
|
|
};
|
|
|
|
export const Secondary = {
|
|
args: {
|
|
...Primary.args,
|
|
primary: false,
|
|
},
|
|
};
|
|
```
|