storybook/docs/snippets/svelte/my-component-story-basic-and-props.js.mdx
2022-07-07 19:15:02 +01:00

29 lines
551 B
Plaintext

```js
// MyComponent.stories.js
import MyComponent from './MyComponent.svelte';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/svelte/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Path/To/MyComponent',
component: MyComponent,
};
export const Basic = {
render: () => ({
Component: MyComponent,
}),
};
export const WithProp = {
render: () => ({
Component: MyComponent,
props: {
prop: 'value',
},
}),
};
```