Are there plans for @storybook/html and @storybook/addon-info to play nicely?
See original GitHub issueCurrently using @storybook/html and @storybook/addon-info breaks storybook. The combo gets an error Expecting an HTML snippet or DOM node from the story.
I would like to use @storybook/html to build HTML/CSS components and have the copy code to the clipboard feature from @storybook/addon-info. The other options in addon-info would be great too, but copy to the clipboard is my primary use case.
There are 2 closed issues that reference my needs #3985 + #2187. The latter mentions using vue, I attempted this but found it adds undesired complexity.
I appreciate all the work that has gone into storybook. Thank you to all the maintainers for their effort. I am unsure if I am able to work on this feature, I’m just curious if this has any priority.
Here is an example of how I’d like to use @storybook/html + @storybook/addon-info in a story…
import { storiesOf } from '@storybook/html';
import { withInfo } from '@storybook/addon-info';
storiesOf('My little pony', module)
.addDecorator(withInfo)
.add('Twilight Sparkle', () => `<div>Twilight Sparkle</div>`)
// OR
storiesOf('Unicorns', module)
.add('Twilight Sparkle', withInfo('Twilight Sparkle')(() => `<div>Twilight Sparkle</div>`))
…and the desired result

Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)

Top Related StackOverflow Question
Will be fixed in https://github.com/storybooks/storybook/issues/1147
Hey @shilman, I just wanted to mention that @kgroat and I built a solution in case anyone else was looking for something. https://github.com/Pickra/copy-code-block Thanks again!