@storybook/addon-controls: argTypes in MDX
See original GitHub issueHow does one provide argTypes
for a given component story in MDX file, with @storybook/addon-controls
?
Environment Info:
System:
OS: macOS 10.15.5
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 10.20.1 - ~/.nvm/versions/node/v10.20.1/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v10.20.1/bin/npm
Browsers:
Chrome: 83.0.4103.116
Safari: 13.1.1
npmPackages:
@storybook/addon-actions: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/addon-controls: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/addon-docs: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/addon-knobs: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/addon-links: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/addons: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/preset-create-react-app: ^2.1.2 => 2.1.2
@storybook/react: ^6.0.0-beta.37 => 6.0.0-beta.37
@storybook/theming: ^6.0.0-beta.37 => 6.0.0-beta.37
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
storybook: Using argtypes in mdx does not have control
I can't see control in storybook. enter image description here But if I write my story in **.stories.js ,anything is ok! enter image...
Read more >Controls - Storybook - JS.ORG
To use the Controls addon, you need to write your stories using args. ... Storybook uses this to auto-generate the ArgTypes for your...
Read more >MDX - Storybook
By applying this pattern with the Controls addon, all anchors will be ignored in Canvas based on how Storybook handles URLs to track...
Read more >ArgTypes - Storybook - JS.ORG
ArgTypes are a first-class feature in Storybook for specifying the behaviour of Args. By ... For instance, to instruct the controls addon to...
Read more >ArgsTable - Storybook - JS.ORG
MyComponent.stories.mdx --> import { ArgsTable } from '@storybook/addon-docs'; import { MyComponent } from './MyComponent'; # My Component!
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 FreeTop 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
Top GitHub Comments
@jayarjo This is how I’ve got it working in my local build (6.0.0-beta.31).
At the top of my
.mdx
file, I defined a variable with myargTypes
configuration:And then referenced that variable in the
Story
tag’sargTypes
attribute:My result:
This documentation helped, too: https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/props-tables.md#customizing-argtypes
HTH!
Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-rc.2 containing PR #13101 that references this issue. Upgrade today to the
@next
NPM tag to try it out!Closing this issue. Please re-open if you think there’s still more to do.