Skip to content

Instantly share code, notes, and snippets.

@shilman
Created December 2, 2019 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shilman/7e75e943080e00c32343f985a1312879 to your computer and use it in GitHub Desktop.
Save shilman/7e75e943080e00c32343f985a1312879 to your computer and use it in GitHub Desktop.
Simple MDX example

import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';

import { Badge } from './Badge'; import { Icon } from './Icon';

Badge

Let's define a story for our Badge component:

Positive

We can drop it in a Preview to get a code snippet:

Negative

We can even preview multiple stories in a block. This gets rendered as a group, but defines individual stories with unique URLs and isolated snapshot tests.

Warning Neutral Error with icon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment