mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:11:49 +08:00
38 lines
738 B
Plaintext
38 lines
738 B
Plaintext
```js
|
|
// YourComponent.stories.js|jsx|ts|tsx
|
|
|
|
import { YourComponent } from './YourComponent';
|
|
|
|
export default {
|
|
/* 👇 The title prop is optional.
|
|
* See https://storybook.js.org/docs/7.0/react/configure/overview#configure-story-loading
|
|
* to learn how to generate automatic titles
|
|
*/
|
|
title: 'YourComponent',
|
|
component: YourComponent,
|
|
};
|
|
|
|
export const ArrayInclude = {
|
|
parameters: {
|
|
controls: { include: ['foo', 'bar'] },
|
|
},
|
|
};
|
|
|
|
export const RegexInclude = {
|
|
parameters: {
|
|
controls: { include: /^hello*/ },
|
|
},
|
|
};
|
|
|
|
export const ArrayExclude = {
|
|
parameters: {
|
|
controls: { exclude: ['foo', 'bar'] },
|
|
},
|
|
};
|
|
|
|
export const RegexExclude = {
|
|
parameters: {
|
|
controls: { exclude: /^hello*/ },
|
|
},
|
|
};
|
|
``` |