#MDX support for Lit2 Web Components

1 messages · Page 1 of 1 (latest)

ocean leaf
#

Hello all. New to Astro, looking to move away from Storybook into a more polished representation of the documentation for the design systems that I, and my company build.

I use Lit2, and was able using the "Just the basics" starter to get Lit components working nice and easy with @astrojs/lit in an .astro file. Then, I decided to see what all the starter kit options looked like; Blog, Portfolio, and most importantly Documentation.

What I can't find or understand, even after reading about https://docs.astro.build/en/guides/integrations-guide/mdx/#components is how to integrate a custom WC into this structure. In Storybook, I have support (haven't dug into exactly how) to have any valid HTML in my .mdx files.

Anything to point me in the correct direction would be greatly appreciated. I saw a few comments on GitHub that "seemed" to say this wasn't supported.
If that IS the case, what I couldn't also find was an example in the "Documentation Starter" of how to implement (I'm new) an .astro file that is inline with other .md/.mdx files in the Pages directory.

#

MDX support for Lit2 Web Components

ocean leaf
#

Still struggling like mad here, trying to implement a TypeScript LIt2 WC inside an MDX file.
I've tried loading it up via the HeaderCommon, inside the mdx, using client:load, etc.

The ONLY way I even sort of saw a functioning WC was to take my compiled dist version of a component in .js format, and move it to /public, and then refer to it with a script tag. And that is problematic at best.

Anyone using WC, TS, MDX & Astro? I'm not asking much right? lol. j/k. I'm always on some weird edge case, and down a road uncommonly travelled it seems.