question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addon-controls: configuring argTypes globally on preview.js

See original GitHub issue

Would 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:closed
  • Created 3 years ago
  • Reactions:37
  • Comments:30 (12 by maintainers)

github_iconTop GitHub Comments

7reactions
shilmancommented, Jan 5, 2022

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!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there’s still more to do.

7reactions
stale[bot]commented, Sep 20, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found