Skip to content

Commit 2a8a7a0

Browse files
committed
add code block tabs to readme
1 parent 1c9f83c commit 2a8a7a0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ You can add a `title` to the code block by adding a title key after the language
6868
console.log('What a great log');
6969
```
7070

71+
### Code block tabs
72+
73+
To use [code block tabs](https://docusaurus.io/docs/markdown-features/code-blocks#multi-language-support-code-blocks) that make some documentation more readable, use a `.mdx` file format and use the following syntax (put the import instructions before your first use of the tabs, or right **after** the front matter headings)
74+
75+
```mdx
76+
import Tabs from '@theme/Tabs';
77+
import TabItem from '@theme/TabItem';
78+
79+
<Tabs>
80+
<TabItem value="tab1" label="Tab1">
81+
82+
83+
84+
</TabItem>
85+
<TabItem value="tab2" label="Tb2">
86+
87+
88+
89+
</TabItem>
90+
</Tabs>
91+
```
92+
7193
### Custom title ids :
7294

7395
The following syntax will allow a link to `[text](/url#my-explicit-id)` instead of the default `[text](/url#hello-world)`

0 commit comments

Comments
 (0)