storybookjs / addon-svelte-csf

[Incubation] CSF using Svelte components.
MIT License
98 stars 29 forks source link

[Question/Documentation] How to use with MDX? #176

Closed rChaoz closed 1 month ago

rChaoz commented 2 months ago

How to include stories defined in a x.stories.svelte in a MDX file?

import Stories from "./Component.stories.svelte"

The following methods all include the first story defined in the stories file:

<Canvas />
<Story />

I don't know what to set the of property to (Stories.Name doesn't work).

rChaoz commented 2 months ago

Update: apparently I was using import Stories instead of the one I should use: import * as Stories. With the latter it works to use <Story of={Stories.Primary} /> (or any named story), although the IDE is giving me "Unresolved variable" warnings.