mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 23:02:00 +08:00
39 lines
882 B
Plaintext
39 lines
882 B
Plaintext
```ts
|
|
// MyComponent.stories.ts|tsx
|
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import { MyComponent } from './MyComponent';
|
|
|
|
const meta: Meta<typeof MyComponent> = {
|
|
component: MyComponent,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof MyComponent>;
|
|
|
|
export const ExampleStory: Story = {
|
|
parameters: {
|
|
a11y: {
|
|
element: '#storybook-root',
|
|
config: {
|
|
rules: [
|
|
{
|
|
// The autocomplete rule will not run based on the CSS selector provided
|
|
id: 'autocomplete-valid',
|
|
selector: '*:not([autocomplete="nope"])',
|
|
},
|
|
{
|
|
// Setting the enabled option to false will disable checks for this particular rule on all stories.
|
|
id: 'image-alt',
|
|
enabled: false,
|
|
},
|
|
],
|
|
},
|
|
options: {},
|
|
manual: true,
|
|
},
|
|
},
|
|
};
|
|
```
|