storybook/docs/snippets/react/my-component-story-basic-and-props.js.mdx
2021-11-04 23:51:08 +00:00

22 lines
477 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/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Path/To/MyComponent',
component: MyComponent,
};
export const Basic = () => <MyComponent />;
export const WithProp = () => <MyComponent prop="value" />;
```