mdx-js-qwik
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

mdx-js-qwik

// vite.config.ts
import { recmaJsxRewriteQwik } from "mdx-js-qwik/plugins"

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>
  );
});

Readme

Keywords

Package Sidebar

Install

npm i mdx-js-qwik

Weekly Downloads

6

Version

1.0.3

License

MIT

Unpacked Size

14 kB

Total Files

13

Last publish

Collaborators

  • langbamit