Addon-controls: configuring argTypes globally on preview.js
See original GitHub issueWould be nice to have a way to configure some controls globally.
Example: imagine that all components contain one prop called ComponentId
and we don’t want this to be showing in the controls table.
How we do now:
On each component.stories.tsx you have to configure it manually within the default export:
export default {
argTypes: { ComponentId: { table: { disabled: true } }
}
Proposal
Add this as configuration inside the preview.js
preview.js
export const argTypes: { ComponentId: { table: { disabled: true } }
And then it will be applied for all stories.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:37
- Comments:30 (12 by maintainers)
Top Results From Across the Web
Controls - Storybook - JS.ORG
Still, you can configure the controls further using argTypes, see below. ... To enable expanded mode globally, add the following to .storybook/preview.js :....
Read more >@storybook/addon-controls - npm
Controls supports the following configuration parameters, either globally or on a per-story basis: Expanded: show property documentation; Hide ...
Read more >How can I add a global control matcher in Storybook?
Addon-controls : configuring argTypes globally on preview.js. It is not exactly what you are looking for in this question.
Read more >Next-level component showcasing with Storybook controls
Learn about controls, a new Storybook addon that lets you dynamically interact with your React components for demo and testing purposes.
Read more >Essential Addons
.storybook/preview.js export const parameters = { // transform any arg ... added some custom configuration to addon controls in preview.js ...
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
Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.9 containing PR #17043 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.
Hi everyone! Seems like there hasn’t been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don’t have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!