storybook/docs/snippets/svelte/your-component-with-decorator.js.mdx
2021-02-10 21:13:23 +01:00

29 lines
480 B
Plaintext

```js
// YourComponent.stories.js
import YourComponent from './YourComponent.svelte';
import MarginDecorator from './MarginDecorator.svelte';
export default {
component: YourComponent,
decorators: [() => MarginDecorator]
};
// Your templates and stories here.
// Don't forget to use the component you're testing and not the MarginDecorator component
```
```html
<!-- MarginDecorator.svelte -->
<div>
<slot/>
</div>
<style>
div {
margin: 3em;
}
</style>
```