carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.72k stars 1.79k forks source link

CodeSnippet: Storybook needs some lovin #8088

Closed guigueb closed 3 years ago

guigueb commented 3 years ago

Summary

The CodeSnippet Storybook examples need a little work to be more clear/helpful to users. This is a storybook documentation issue.

Justification

Clients trying out CodeSnippet in the Storybook environment would like it to be more helpful.

Desired UX and success metrics

Each story should have story code showing the exact props used to create it (not deconstructed props {...props}).

Each story should have a list of knobs available for it.

All the props in CodeSnippet should be reflected in knobs. The following props are missing... className, children, onClick.

In knobs the prop being applied should be clear. The prop Copy button title _____ doesn't clearly indicate what prop is being used. Possibly follow the other descriptions Copy button title (copyButtonDescription) ____. But I would suggest all of carbon adopt a standard...

"Must have" functionality

Ideally, to be most helpful to clients, in all stories, not just CodeSnippet, we would show...

Specific timeline issues / requests

anytime

Available extra resources

tw15egan commented 3 years ago

Yes, this component needs to be updated to match components like Accordion and Button that have variants without using knobs so that they can easily be copied, as well as a Playground variant that has all knobs available.

The knobs should also have the exact prop name in parentheses, and a short one-line description of the prop.