[Bug] argTypes not working in mdx
See original GitHub issueWhat version of vite
are you using?
2.9.13
System info and storybook versions
System:
OS: Windows 10 10.0.19044
CPU: (12) x64 Intel(R) Core(TM) i7-10750
H CPU @ 2.60GHz
Binaries:
Node: 18.4.0 - ~\scoop\persist\nvm\nodej
s\nodejs\node.EXE
npm: 8.12.1 - ~\scoop\persist\nvm\nodejs
\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromiu
6.5.9
@storybook/addon-links: ^6.5.9 => 6.5.9
@storybook/addon-notes: ^5.3.21 => 5.3.21
@storybook/addon-postcss: ^2.0.0 => 2.0.0
@storybook/builder-vite: ^0.1.36 => 0.1.38
@storybook/csf-tools: ^6.5.9 => 6.5.9
@storybook/testing-library: ^0.0.13 => 0.0.13
@storybook/theming: ^6.5.9 => 6.5.9
@storybook/vue3: ^6.5.9 => 6.5.9
Describe the Bug
When using argsTypes in MDX the changes are not being applied to the argsTable. The same component and config works as expected when using a normal CSF file.
Reproduction:
component.stories.mdx
import { Meta, Canvas, Story, ArgsTable, Description } from '@storybook/addon-docs'
const Component = {
description: 'test',
props: {
id: String(),
status: String(),
label: String()
},
__docgenInfo: {
displayName: 'component',
props: [
{name: 'id', required: true, type: {name: 'number'}},
{name: 'status', required: true, type: {name: 'string'}},
{name: 'label', required: true, type: {name: 'string'}}
]
}
}
<Meta title="component" component={Component} argTypes={{
status: {
name: 'Badge Status',
description: 'Available options available to the Badge',
options: [
'positive',
'negative',
'warning',
'error',
'neutral'
],
table: {
defaultValue: {
summary: 'positive'
},
type: {
summary: 'Shows options to the Badge',
detail: 'Listing of available options'
},
},
},
label: {
name: 'Badge Content',
description: 'Text shown by Badge',
control: {
type: 'text'
},
table: {
type: {
summary: 'The label contents',
detail: 'Text displayed by the Badge'
}
}
}
}} />
<ArgsTable for={Component} />
Link to Minimal Reproducible Example
No response
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
storybook: Using argtypes in mdx does not have control
That's weird because in our projects we are using this approach and it's working. In this link, I can't see an example with...
Read more >MDX Format - Storybook - JS.ORG
MDX is a standard file format that combines Markdown with JSX. It means you can use Markdown's terse syntax (such as # heading...
Read more >storybook/addon-controls - npm
Start using @storybook/addon-controls in your project by running `npm i ... Knobs is also a mature addon, with various options that are not...
Read more >Storybook: addons/docs/docs/props-tables.md - Fossies
Customizing ArgTypes; Custom ArgTypes in MDX ... In order to show controls, ArgsTable must be a function of a story, not a component:...
Read more >Next-level component showcasing with Storybook controls
At the time of this writing, Storybook does not work out of the ... We have to configure the controls further with the...
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
MDX ArgsTable is working for me on the 7.0.0 beta
@joshwooding do you have any links to issues or docs regarding this issue? i was searching for known issues surrounding this matter while i was debugging, but couldn’t find any.