storybook/docs/snippets/angular/my-component-with-env-variables.mdx.mdx
2021-08-09 19:19:01 +01:00

21 lines
514 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story, Canvas } from '@storybook/addon-docs';
import MyComponent from './my-component.component';
<Meta title="A MDX story using environment variables inside a .env file" component={MyComponent}/>
export const Template = (args) => ({ props: args });
<Canvas>
<Story
name="A MDX story using environment variables inside a .env file"
args={{
propertyA: process.env.STORYBOOK_DATA_KEY,
}}>
{Template.bind({})}
</Story>
</Canvas>
```