Closed charlesfonlupt closed 1 year ago
I tried to import icons directly, but it present the same problem. The page does not render properly and there is no indication on the possible error from the server.
import {Meta} from '@storybook/addon-docs/blocks';
import {IconGallery, IconItem} from "@storybook/addon-docs";
import Building001 from '../components/icons/building/building001.vue';
<Meta title="Foundations/Iconography" />
# Iconography
<IconGallery>
<IconItem name="Building001">
<Building001 />
</IconItem>
</IconGallery>
I have the same issue with Vue 3
Still relevant in SB7.
I assume due to the children
wont match the type React.ReactNode
@chakAs3 you have a pretty good handle on SB7 and Vue, is there any quick wins / workarounds here?
My thinking was that it would be great if we could do something like this as a workaround
<IconGallery>
<IconItem name="Building001">
<Vue>
<Building001 />
</Vue>
</IconItem>
</IconGallery>
So heres a workaround.
import { Meta, Canvas, Story, Stories, IconGallery, IconItem } from '@storybook/addon-docs'
import * as IconStories from './Icon.stories.ts'
<Meta title="Style Guide/Icons" />
# Icons
<IconGallery>
<IconItem name="Spinner">
<Story of={IconStories.Spinner} />
</IconItem>
</IconGallery>
Icon.stories.ts, here is just a valid CSF3 story file exporting some stories.
Hi @blowsie how are doing ? can you explain me more, the constraint that you have and what you want to achieve, i pretty sure that will be relevant for others as well
@chakAs3 as mentioned above <IconItem>
is expecting a React.ReactNode
child, so its not possible to insert Vue Icon Components as a direct child.
My workaround here is to add the Icons to a giant story file and then use the <Story>
component as a child instead.
In the end, users will end up here because the docs doesn't provide a full working solution.
Oh. it is interesting, i never looked at mdx document, i see the issue, this will be always buggy as we only use Reat to write blocks and mdx docs, we planed to look if this and provide proper Vue mdx tool.
Hi, folks. I'm sorry this bug has sat with needs triage
so long. Not sure how it fell through the cracks like that.
MDX in Storybook was built on MDX 1, originally, which only supported React. Storybook 7 now uses MDX 2, which supports other renderers, like Vue, but Storybook's MDX implementation is still React-only, for now.
And the Doc Blocks, like IconGallery, are designed for Storybook's MDX. The API reference linked above makes it clear that this only works with React.
As this is intended (though unfortunate) behavior, and not a bug, I'm closing this issue.
I'd encourage you to upvote and add your thoughts to this existing feature request: https://github.com/storybookjs/storybook/issues/7729
hello @kylegach , quick question, if i'm not mistaken, currently no vue components can be integrated and used in mdx, correct ?
it doesn't work for me, and otherwise the following storybook-addon-vue-mdx wouldn't exist, would it ?
thx, have a :sun_with_face: y
day
Describe the bug
I am trying to implements Icons documentation through StoryBook 6.5.12 (Vue3, Vite) following the doc
All my icons are listed as component in a icons.vue file
When trying to Import them, the mdx page does not render properly.
System
Additional context
StoryBook is used in a Nuxt3 project