Add markdown documentation to your stories that displays on your device
The Notes Addon allows you to write documentation for your stories using text or markdown. This is perfect for providing usage guidelines, implementation details, or design notes directly within your Storybook.
Notes support full markdown syntax for rich documentation:
MyComponent.stories.tsx
import type { Meta } from '@storybook/react-native';import { MyComponent } from './MyComponent';const meta = { title: 'Components/MyComponent', component: MyComponent, parameters: { notes: `# MyComponentA reusable component for displaying content.## Usage\`\`\`tsximport { MyComponent } from './MyComponent';<MyComponent title="Hello" />\`\`\`## Props- **title**: The heading text to display- **subtitle**: Optional secondary text- **onPress**: Callback when component is pressed## ExamplesPut a full new line between each element for proper markdown rendering. `, },} satisfies Meta<typeof MyComponent>;export default meta;
When using markdown, ensure you put a full empty line between elements (headings, lists, code blocks) for proper rendering.
Here’s a comprehensive example with detailed documentation:
ActionButton.stories.tsx
import type { Meta, StoryObj } from '@storybook/react-native';import { fn } from 'storybook/test';import { ActionButton } from './ActionButton';const meta = { component: ActionButton, parameters: { notes: `# ActionButtonA pressable button component with customizable styling and callbacks.## Installation\`\`\`bashimport { ActionButton } from './components/ActionButton';\`\`\`## Basic Usage\`\`\`tsx<ActionButton text="Press me!" onPress={() => console.log('pressed')} />\`\`\`## Props- **text** (string, required): The button label text- **onPress** (function, required): Callback when button is pressed- **disabled** (boolean, optional): Whether the button is disabled- **variant** ('primary' | 'secondary', optional): Button style variant## Examples### Primary Button\`\`\`tsx<ActionButton text="Submit" variant="primary" onPress={handleSubmit} />\`\`\`### Disabled Button\`\`\`tsx<ActionButton text="Loading..." disabled={true} onPress={handlePress} />\`\`\`## AccessibilityEnsure you provide meaningful text for screen readers.## NotesRemember to put a full new line between each element for proper markdown rendering. `, },} satisfies Meta<typeof ActionButton>;export default meta;type Story = StoryObj<typeof meta>;export const Basic: Story = { args: { text: 'Press me!', onPress: fn(), },};
import type { Meta, StoryObj } from '@storybook/react-native';import { Button } from './Button';const meta = { component: Button, parameters: { notes: 'Default notes for all stories.', },} satisfies Meta<typeof Button>;export default meta;type Story = StoryObj<typeof meta>;export const Primary: Story = { parameters: { notes: `# Primary ButtonThe primary action button used for main CTAs.**Usage**: Use for the most important action on a screen. `, },};export const Secondary: Story = { parameters: { notes: `# Secondary ButtonThe secondary action button used for alternative actions.**Usage**: Use for less prominent actions. `, },};
parameters: { notes: `## When to Use- Use for primary actions- Use when you need user confirmation## When Not to Use- Don't use for navigation- Don't use for inline editing `,}