storybook/docs/snippets/angular/my-component-with-env-variables.mdx.mdx
2021-10-11 23:50:18 +01:00

23 lines
594 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}/>
<!-- 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) => ({
props: args,
})} />
</Canvas>
```