storybook/docs/snippets/svelte/my-component-story-basic-and-props.js.mdx
2022-11-17 16:33:22 +01:00

30 lines
552 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',
},
}),
};
```