storybook/docs/snippets/react/my-component-story-basic-and-props.js.mdx
2022-07-07 19:47:29 +01:00

22 lines
475 B
Plaintext

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