Skip to content
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

Sharing knob values across stories #8

Open
Firebrand opened this issue Mar 25, 2021 · 2 comments
Open

Sharing knob values across stories #8

Firebrand opened this issue Mar 25, 2021 · 2 comments

Comments

@Firebrand
Copy link

I've scoured the forum here as well as resources online, but can't seem to find an answer. How would I go about sharing knob values across different COMPONENTS? (ex. User navigates to a button component in Storybook and chooses to make it green, they then navigate to a form component -which includes the prev button as a subcomponent- and the button in there appears green).

I do not wish to use Storybook Controls as they do not support groups and thus make the interface very cumbersome for components with many settings.

Thanks so much guys!

@shilman
Copy link
Member

shilman commented Mar 26, 2021

FYI, we’ve released addon-controls in Storybook 6.0. Controls are portable, auto-generated knobs that are intended to replace addon-knobs, which are slated for deprecation.

Please upgrade and try out controls today!

Regarding your question, controls are based on something called args: https://storybook.js.org/blog/introducing-storybook-args/

Args are designed to be re-used and composed across stories: https://storybook.js.org/docs/react/writing-stories/args#args-composition

@Firebrand Firebrand reopened this Mar 28, 2021
@Firebrand
Copy link
Author

@shilman I really appreciate your response. I have edited my original post. Cheers.

@shilman shilman transferred this issue from storybookjs/storybook May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants