Skip to content

Sharing knob values across stories #8

Open

Description

@Firebrand

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!

Activity

  1. shilman commented on Mar 26, 2021

    @shilman
    Contributor

    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

  2. Firebrand commented on Mar 28, 2021

    @Firebrand
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions