mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
27 lines
662 B
Plaintext
27 lines
662 B
Plaintext
```ts
|
|
// FooBar.stories.ts|tsx
|
|
|
|
import { Foo } from './Foo';
|
|
|
|
// 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
|
|
*/
|
|
title: 'OtherFoo/Bar',
|
|
component: Foo,
|
|
id: 'Foo/Bar', // Or 'foo-bar' if you prefer
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof Foo>;
|
|
|
|
export const Baz: Story = {
|
|
name: 'Moo',
|
|
};
|
|
```
|