storybook/docs/snippets/svelte/component-story-figma-integration.js.mdx
2022-07-07 19:15:02 +01:00

32 lines
780 B
Plaintext

```js
// MyComponent.stories.js
import { withDesign } from 'storybook-addon-designs';
import MyComponent from './MyComponent.svelte';
// More on default export: https://storybook.js.org/docs/7.0/svelte/writing-stories/introduction#default-export
export default {
title: 'FigmaExample',
component: { MyComponent },
decorators: [withDesign],
};
/*
*👇 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.
*/
export const Example = {
render: () => ({
Component: MyComponent,
props: {},
}),
parameters: {
design: {
type: 'figma',
url: 'https://www.figma.com/file/Sample-File',
},
},
};
```