mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
22 lines
623 B
Plaintext
22 lines
623 B
Plaintext
```md
|
|
<!-- MyComponent.stories.mdx -->
|
|
|
|
import { Meta, Story, Canvas } from '@storybook/addon-docs';
|
|
|
|
import MyComponent from './MyComponent';
|
|
|
|
<Meta title="A MDX story using environment variables inside a .env file" />
|
|
|
|
export const Template = (args) => <MyOtherComponent {...args} />
|
|
|
|
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
|
|
|
|
<Canvas>
|
|
<Story
|
|
name="A MDX story using environment variables inside a .env file"
|
|
args={{
|
|
propertyA: process.env.STORYBOOK_DATA_KEY,
|
|
}}
|
|
render={(args) => <MyOtherComponent {...args} />} />
|
|
</Canvas>
|
|
``` |