Code editor: multi-language
2 min
code editor multi language docid dmwewv5w9ycnvmlcui53 blocks group multiple code snippets into a single container with a language switcher they are useful for presenting examples in different programming languages without taking up additional space syntax you can add this component using either markdown or mdx \ codeblocktabs ```javascript const greeting = 'hello, world!' console log(greeting) ``` ```python greeting = "hello, world!" print(greeting) ``` ```bash echo "hello, world!" ``` \ \<codeblocktabs> ```javascript const greeting = 'hello, world!' console log(greeting) ``` ```python greeting = "hello, world!" print(greeting) ``` ```bash echo "hello, world!" ``` \</codeblocktabs> each fenced code block inside a codeblocktabs container becomes a separate tab the tab title is automatically generated from the language identifier of the code block, such as javascript , python , or bash if you only need to display a single snippet, use a standard fenced code block instead ```javascript const x = 1 ```
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.