Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit 7ca8fa2

Browse files
committed
docs: update writing mdx
1 parent 3277e63 commit 7ca8fa2

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/docs/documentation/general/writing-mdx.mdx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ More details about MDX in the [Official website.](https://mdxjs.com/)
1515
## Working with components
1616

1717
For now, you only need to know that with MDX you can use your components inside markdown.
18-
But how? Let's take a look at how we can improve our `.mdx` created before by importing and using a component inside it. The example below assumes we have a exported component named `Button` in a file named `Button.jsx`/`Button.tsx` located in the same folder as the `.mdx`-file we are editing.
18+
But how? Let's take a look at how we can improve our `.mdx` file created previously by importing and using a component inside it.
1919

20-
```markdown
20+
The example below assumes we have an exported component named `Button` in a file named `Button.jsx`/`Button.tsx` located in the same folder as the `.mdx` file we are editing.
21+
22+
```mdx
2123
---
2224
name: Hello world
2325
---
@@ -26,17 +28,16 @@ import { Button } from './Button'
2628

2729
# Hello world
2830

29-
Hello, I'm still a mdx file, but now I have a button component!
31+
Hello, I'm still a mdx file, but now I have a button component !
3032

31-
<Button>Click</Button>
33+
<Button onClick={() => { alert("You clicked me"); }}>Click me</Button>
3234
```
3335

34-
And, if you really have a `Button` component to import, you'll see something like this:
36+
And, if you do have a `Button` component to import, you'll see something like this:
37+
38+
![Documentation site showing a rendered button along with Markdown](https://cdn-std.dprcdn.net/files/acc_649651/Fgbg4F)
3539

36-
![](https://cdn-std.dprcdn.net/files/acc_649651/Fgbg4F)
40+
With MDX you can mix _React Components_ or _html-elements_ with regular markdown allowing you to either document your own components _or_ create helper components that make documentation easier.
3741

38-
With MDX you can mix _React Components_ or _html-elements_ with regular markdown allowing you to either document your own components _or_ creating helper components that makes documentation easier. **Docz** comes with some prebuilt helper components which will help you document components faster, these are covered in [**Built-in components**](/docs/built-in-components).
42+
**Docz** comes with some helper components that will help you document your components faster, these are covered in [**Built-in components**](/docs/built-in-components).
3943

40-
> ### Note
41-
>
42-
> So far Docz only works with React components. But stay calm, we are working to bring Preact, Vue and some others libraries to Docz!

0 commit comments

Comments
 (0)