#IconGallery component in TS

4 messages · Page 1 of 1 (latest)

dusk cypress
#

👋 - Hi, does anyone know a way of using the IconGallery/IconItem components from Storybook components in a typescript story? I'm wanting to create a story for an angular Icon component, but use these to wrap them for layout etc. I've only seen them used in mdx files

soft siren
#

I wouldn't think they'd work in regular Angular files because they're React components.

dusk cypress
#

True. But Storybook is still React under the hood right? And it just reads in a Story file which has some decorators to make the angular bits work, but at its core it's still React.

I don't mean try and use them in an Angular component, I mean in a vanilla TS file, where you define all the Story props

low knoll
#

I think dom is right. Storybook is just React under the hood, but only the manager parts. The preview (or canvas, or iframe) is whatever framework you're using. And if I understand you correctly you want to wrap your story content with the IconGallery component, which would mean that the preview would both contain React and Angular, which it can't do.
However the IconGallery component is very simple, you can re-implement it in Angular if you want to.
https://github.com/storybookjs/storybook/tree/next/code/ui/blocks/src/components/IconGallery.tsx