fbredius/storybook

View on GitHub
docs/snippets/react/my-component-story-basic-and-props.js.mdx

Summary

Maintainability
Test Coverage
```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" />;
```