From 3d3864da094d9576fcb6e09e3197c5a3c677bb77 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Tue, 2 Apr 2024 14:17:11 -0400 Subject: [PATCH] chore: content reshuffling --- .../en/guides/integrations-guide/markdoc.mdx | 157 +++++++++--------- 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/src/content/docs/en/guides/integrations-guide/markdoc.mdx b/src/content/docs/en/guides/integrations-guide/markdoc.mdx index 2dca95789c272..645d722bf82af 100644 --- a/src/content/docs/en/guides/integrations-guide/markdoc.mdx +++ b/src/content/docs/en/guides/integrations-guide/markdoc.mdx @@ -117,7 +117,7 @@ const { Content } = await entry.render(); See the [Astro Content Collection docs][astro-content-collections] for more information. -## Markdoc config +## Render components `@astrojs/markdoc` offers configuration options to use all of Markdoc's features and connect UI components to your content. @@ -159,64 +159,69 @@ Use tags like this fancy "aside" to add some _flair_ to your docs. {% /aside %} ``` -### Use Astro components from npm packages and TypeScript files +### Use client-side UI components -You may need to use Astro components exposed as named exports from TypeScript or JavaScript files. This is common when using npm packages and design systems. +Tags and nodes are restricted to `.astro` files. To embed client-side UI components in Markdoc, [use a wrapper `.astro` component that renders a framework component](/en/guides/framework-components/#nesting-framework-components) with your desired `client:` directive. -You can pass the import name as the second argument to the `component()` function: +This example wraps a React `Aside.tsx` component with a `ClientAside.astro` component: + +```astro title="src/components/ClientAside.astro" +--- +import Aside from './Aside'; +--- + +