mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 18:01:51 +08:00
29 lines
417 B
Plaintext
29 lines
417 B
Plaintext
```js
|
|
// Button.stories.js|jsx|ts|tsx
|
|
|
|
import { Button } from './Button';
|
|
|
|
export default {
|
|
component: Button,
|
|
argTypes: {
|
|
backgroundColor: { control: 'color' },
|
|
},
|
|
};
|
|
|
|
// This is an accessible story
|
|
export const Accessible = {
|
|
args: {
|
|
primary: false,
|
|
label: 'Button',
|
|
},
|
|
};
|
|
|
|
// This is not
|
|
export const Inaccessible = {
|
|
args: {
|
|
...Accessible.args,
|
|
backgroundColor: 'red',
|
|
},
|
|
};
|
|
```
|