mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 06:41:25 +08:00
# Conflicts: # addons/a11y/package.json # addons/actions/package.json # addons/backgrounds/package.json # addons/cssresources/package.json # addons/events/package.json # addons/google-analytics/package.json # addons/info/package.json # addons/jest/package.json # addons/knobs/package.json # addons/links/package.json # addons/notes/package.json # addons/storyshots/storyshots-core/package.json # addons/viewport/package.json # app/react/package.json # examples/cra-kitchen-sink/package.json # examples/official-storybook/package.json # examples/preact-kitchen-sink/package.json # lib/addons/package.json # lib/channel-websocket/package.json # lib/components/package.json # lib/core/package.json # lib/ui/package.json # yarn.lock
Storybook Addon Notes
Storybook Addon Notes allows you to write notes (text or HTML) for your stories in Storybook.
Getting Started
NOTE: Documentation on master branch is for alpha version, stable release is on master
yarn add -D @storybook/addon-notes
Then create a file called addons.js
in your storybook config.
Add following content to it:
import '@storybook/addon-notes/register';
You can use the notes
parameter to add a note to each story:
import { storiesOf } from '@storybook/react';
import Component from './Component';
storiesOf('Component', module)
.add('with some emoji', () => <Component />, {
notes: 'A very simple example of addon notes',
});
Using Markdown
To use markdown in your notes is supported, storybook will load markdown as raw by default.
import { storiesOf } from '@storybook/react';
import Component from './Component';
import notes from './someMarkdownText.md';
storiesOf('Component', module)
.add('With Markdown', () => <Component />, { notes });