maiieul-mdx-js-qwik
v0.1.4
Published
MDX custom components with Qwik backend
Downloads
4
Readme
mdx-js-qwik
// vite.config.ts
qwikCity({
mdx: {
providerImportSource: "mdx-js-qwik",
recmaPlugins: [recmaJsxRewriteQwik],
},
});
// layout.tsx
import { component$, Slot } from "@builder.io/qwik";
import { MDXProvider } from "mdx-js-qwik";
export const components = {
h1: component$((props) => (
<h1 {...props} class="h1">
<Slot />
</h1>
)),
h2: component$((props) => (
<h2 {...props} class="h2">
<Slot />
</h2>
)),
};
export default component$(() => {
return (
<MDXProvider components={components}>
<Slot />
</MDXProvider>
);
});