New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgTypes table.defaultValue
not showing in MDX ArgsTable on Docs Tab
#15838
Comments
table.defaultValue
and description
not showing in MDX ArgsTable on Docs Tabtable.defaultValue
not showing in MDX ArgsTable on Docs Tab
In the doc-blocks docs it says you cannot use So I tried the |
@dexster thanks for checking on discord. But also worth mentioning, I'm not trying to customize it via the ArgsTable element. I'm defining the ArgTypes in the Meta element, which according to the documentation should work with MDX docs the same as with regular tsx/jsx stories. And @shilman seemed to indicate in the linked issue, that it should work. |
Hey. I understand your issue. It's exactly the same as mine. I'm just interpreting the docs as saying that anything you define with ArgTypes won't work when using |
@dexster is right on both counts. you should use In the meantime, as a workaround you can remove the |
@shilman I'm still confused as to how to do this. I have specified the table in Meta argTypes and removed the component property but what must the ArgsTable look like in the MDX file? When I use the story link like this, |
I think in the current state of things it works like this:
As I said before this needs some work 😭 |
Seems like, there is no need in
(just use it instead of |
Seems like it's bugged though. |
Ok, here is what has worked for me: // No need to change 👇
<Meta
title="Theme/QtmThemeProvider"
component={QtmThemeProvider}
argTypes={{
themeSetting: {
type: 'QtmThemeSetting',
description: 'Determines what theme should be applied to the application.',
table: {
defaultValue: { summary: 'light' }
},
}
}}
/>
// The crucial part 👇
<ArgsTable story="." /> Storybook version: |
Experiencing the same issue here on
In the Canvas view, the table will correctly show The proposed workaround of removing @Katarina-UBCO's alternative isn't applicable for us since we aren't using MDX. We default to the Docs tab, so would really like to see this addressed as it makes discovery of the default values more difficult for our users. |
This seems to have gotten even worse in v7 beta. I have the following in my import * as ButtonStories from './Button.stories.tsx';
import { Button } from './Button.tsx';
<Meta of={ButtonStories} />
# Button
## Arguments
<ArgsTable of={Button} /> And in export default {
title: 'Atoms/Button',
component: Button,
argTypes: {
onClick: { action: 'clicked', table: { disable: true } },
variant: { table: { defaultValue: { summary: `"primary"` } } },
size: { table: { defaultValue: { summary: `"large"` } } },
},
}; This results in the args table being completely different in the docs and in the stories. However, if I change the |
Describe the bug
Defining a default value and description manually using argTypes on the Meta element of an MDX-based Story isn't showing in the ArgsTable on the Docs tab. It shows both in the control panel of the Canvas tag, but not Docs.
Example
Docs
Canvas
To Reproduce
Reproduction repo: https://github.com/michaelfaith/storybook-mdx-argtype-bug
System
The text was updated successfully, but these errors were encountered: