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

Code Preview for Knobs #24

Open
danyball opened this issue Jan 30, 2020 · 8 comments
Open

Code Preview for Knobs #24

danyball opened this issue Jan 30, 2020 · 8 comments

Comments

@danyball
Copy link

We are producing WebComponents with several options. The Addon "Knobs" is perfect to show the result of the combination of these knobs.
Our customers wants to compose their combination of knobs they want and copy that sourcecode. Our goal would be to show that code as a preview and give the possibility to copy that with one click.

For example we have the component "axa-button":
The code of the story is like
<axa-button variant="${allVariants}"</axa-button>

and if the user choose "red" from knobs addon, he wants to get that code-snippet to copy:
<axa-button variant="red"</axa-button>

You can find that button showcase for our project here.

Is or would that be possible?

Thanks
Daniel

@storybookjs storybookjs deleted a comment from stale bot Feb 21, 2020
@shilman
Copy link
Member

shilman commented Feb 21, 2020

@danyball this is a great feature. we're making a bunch of changes inside storybook that will make this easier to do in a cross-framework way, but currently don't have a timeline on delivery. i've marked this as todo so that it doesn't get lost in the noise!

@habemuscode
Copy link

Duplicate? storybookjs/storybook#9801 Close other if duplicate :)

@danyball
Copy link
Author

danyball commented Apr 2, 2020

Duplicate? storybookjs/storybook#9801 Close other if duplicate :)

Not a duplicate

@Stafie
Copy link

Stafie commented May 11, 2020

Would love to be able to do that! Looks like the guys from wix are doing it here:
https://wix-style-react.now.sh/?activeTab=Playground&path=%2Fstory%2Fcomponents-api-components--button

@shilman
Copy link
Member

shilman commented May 28, 2020

Hi gang, We’ve just released addon-controls in 6.0-beta!

Controls are portable, auto-generated knobs that are intended to replace addon-knobs long term.

Please upgrade and try them out today. Thanks for your help and support getting this stable for release!

@colinmosher
Copy link

@shilman it doesn't seem like addon-controls addresses the original issue here?

@shilman
Copy link
Member

shilman commented Jun 1, 2020

For anybody who is interested in Controls but don't know where to start, I've created a quick & dirty step-by-step walkthrough to go from a fresh CRA project to a working demo. Check it out:

=> Storybook Controls w/ CRA & TypeScript

There are also some "knobs to controls" migration docs in the Controls README:

=> How do I migrate from addon-knobs?

@shilman
Copy link
Member

shilman commented Jun 1, 2020

@colinmosher Not yet. But it’s in progress and when us done, it will work with controls and very likely will NOT work with knobs. Therefore it’s important that knobs users know about controls and consider migrating!

@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

5 participants