mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
23 lines
502 B
Plaintext
23 lines
502 B
Plaintext
```tsx
|
|
// MyComponent.stories.ts|tsx
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta, StoryObj } from '@storybook/your-framework';
|
|
|
|
import { MyComponent } from './MyComponent';
|
|
|
|
const meta: Meta<typeof MyComponent> = {
|
|
component: MyComponent,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof MyComponent>;
|
|
|
|
export const ExampleStory: Story = {
|
|
args: {
|
|
propertyA: import.meta.env.STORYBOOK_DATA_KEY,
|
|
propertyB: import.meta.env.VITE_CUSTOM_VAR,
|
|
},
|
|
};
|
|
```
|