Addon-docs: Decorators for MDX and DocsPage
See original GitHub issueIs your feature request related to a problem? Please describe. I would like to be able to add custom widgets at the top of all my MDX pages.
Ideally, I would define those widgets once in some kind of container that would wrap all my MDX pages.
Describe the solution you’d like It could be achieve by a decorator with the same behavior as the story decorator but for MDX and DocsPage.
addDocsDecorator((page, context) => <DocsContainer page={page} ... />)
Describe alternatives you’ve considered
- Manually add the widgets in all my MDX pages.
- Support tool addon in MDX pages
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Compare DocsPage and MDX syntax in Storybook with example
This post compares the DocsPage and MDX syntax to write story of your UI components using Storybook. We will continue with the Card...
Read more >MDX - Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >storybook/addon-docs - npm
DocsPage is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, ...
Read more >Storybook Docs with mdx support and addon knobs - Medium
page: DocsPage } });function loadStories() { ... Badge.mdximport { Story } from '@storybook/addon-docs/blocks'; import Badge from '../../.
Read more >Documenting design systems with Storybook Docs
Released in Storybook v5.3, MDX aims to provide full control over ... import { Canvas, Meta, Story } from '@storybook/addon-docs/blocks' ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think you can do this already, though with a slightly less flexible mechanism. Let’s suppose I want to wrap every docs page with a red border. It should be possible using something like this:
Just for documentation completeness purposes, the following is also an equivalent: