mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
40 lines
768 B
Plaintext
40 lines
768 B
Plaintext
```ts
|
|
// YourComponent.stories.ts|tsx
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta, StoryObj } from '@storybook/your-framework';
|
|
|
|
import { YourComponent } from './YourComponent';
|
|
|
|
const meta: Meta<typeof YourComponent> = {
|
|
component: YourComponent,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof YourComponent>;
|
|
|
|
export const ArrayInclude: Story = {
|
|
parameters: {
|
|
controls: { include: ['foo', 'bar'] },
|
|
},
|
|
};
|
|
|
|
export const RegexInclude: Story = {
|
|
parameters: {
|
|
controls: { include: /^hello*/ },
|
|
},
|
|
};
|
|
|
|
export const ArrayExclude: Story = {
|
|
parameters: {
|
|
controls: { exclude: ['foo', 'bar'] },
|
|
},
|
|
};
|
|
|
|
export const RegexExclude: Story = {
|
|
parameters: {
|
|
controls: { exclude: /^hello*/ },
|
|
},
|
|
};
|
|
```
|