What is the best way to copy the code from Polaris storybook web components?
Hey again @app
- right now we don’t offer a simple way to pull the example code from Storybook directly, but there should be code examples in the dev docs for each component. For example, if I’m looking at the button component in Storybook here:
https://storybook.polaris-admin.shopify.dev/?path=/story/button--button
I should then be able to grab some boilerplate code here:
https://shopify.dev/docs/api/app-home/polaris-web-components/actions/button
It’s not the most ideal though, so I definitely understand where you’re coming from. More than happy to set up a feature request for you on my end. Just to clarify, would your ideal feature for this just to have the code populate in a box when you’re looking at it in Storybook? I believe this is a feature some third party plugin developers offer for Storybook, so it is possible.
I can’t guarantee that we’d implement this but I can certainly pass on the request. Hope to hear from you again soon, always happy to help ![]()
Thanks @Alan_G as always,
Have a good one! ![]()
No worries! Just confirming I passed some feedback along to our product teams for you so that we can look into making it easier to grab example code directly from the Storybook. I can’t guarantee that we’ll implement this or if we do, when that would be, but I did just want to loop back with you here to let you know that’s been sent their way.
Hope this helps ![]()