mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:41:58 +08:00
28 lines
729 B
Plaintext
28 lines
729 B
Plaintext
```ts
|
|
// components/MyComponent/MyComponent.stories.js|jsx
|
|
|
|
import { MyComponent } from './MyComponent.js';
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta, StoryObj } from '@storybook/your-framework';
|
|
|
|
// To apply a set of backgrounds to all stories of Button:
|
|
const meta: Meta<typeof Foo> = {
|
|
/* 👇 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
|
|
*/
|
|
component: MyComponent,
|
|
title: 'components/MyComponent/MyComponent',
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof Foo>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
something: 'Something else',
|
|
},
|
|
};
|
|
```
|