Replies: 1 comment 1 reply
-
Hi @mdbiscan! I'm Dosu and I’m helping the storybook team. Storybook shows argTypes: {
size: {
table: {
type: { summary: 'ButtonSize' }, // This will show 'ButtonSize' in the Type column
},
// ...other config
},
} You can also use the simpler For displaying constant values (like argTypes: {
size: {
defaultValue: 'md', // instead of Button.SIZE.MD
options: ['sm', 'md', 'lg'], // instead of [Button.SIZE.SM, ...]
table: {
type: { summary: "'sm' | 'md' | 'lg'" },
defaultValue: { summary: "'md'" },
},
},
} This approach guarantees the Docs table displays the intended values and type info, not just variable names or If you need to show a more complex type or value, you can use the Let me know if you want an example for a specific prop! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I cannot find a clear answer in the documentation or searching around this repo for how to fix the
unknown
type label. Why are all the types unknown, except for a few and why can't I customize them? I understand Storybook is trying to infer the type, but how can I override it?Additional information
React v19
Storybook v9.1.4
Addons:
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions