storybook/docs/snippets/svelte/my-component-with-env-variables.mdx.mdx
2022-07-07 19:15:02 +01:00

27 lines
624 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import MyComponent from './MyComponent.svelte';
<Meta title="MyComponent" component={MyComponent}/>
<!--
👇 Render functions are a framework specific feature to allow you control on how the component renders.
See https://storybook.js.org/docs/7.0/svelte/api/csf
to learn how to use render functions.
-->
<Canvas>
<Story
name="ExampleStory"
args={{
propertyA: process.env.STORYBOOK_DATA_KEY,
}}
render={(args) => ({
Component: MyComponent,
props: args,
})} />
</Canvas>
```