After searching extensively, I discovered that formatted code can be added within another tag called CodeBlock and imported. Finally, the code appears as follows:

```mdx-code-block
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
```
<mdx-code-block>
<Tabs>
<TabItem value="current" label="Current">
<CodeBlock language="php">
{`$event = request()->event;
$causerName = request()->causerName;
$causerLastName = request()->causerLastName;
$action = request()->action;
$role = request()->role;
$initDate = request()->initDate;
$finDate = request()->finDate;
`}
</CodeBlock>
</TabItem>

I hope this helps you.

Answer from dcandamil on Stack Overflow
🌐
Docusaurus
docusaurus.io › guides › markdown features › code blocks
Code blocks | Docusaurus
July 10, 2026 - You will also need to add the plugin to your docusaurus.config.js. ... To use the plugin, create a code block with live attached to the language meta string.
Starred by 32 users
Forked by 5 users
Languages: TypeScript 64.8% | JavaScript 29.0% | CSS 6.2%
🌐
The DAX Shepherd
datashepherd.dev › home › syntax highlighting in docusaurus
Syntax Highlighting in Docusaurus
January 31, 2023 - Remember that we are only adding ... you can add the language, but it will take more work. Code blocks start with 3 backticks and end with 3 backticks....
🌐
npm
npmjs.com › package › @docusaurus › theme-live-codeblock
docusaurus/theme-live-codeblock
Docusaurus live code block component.. Latest version: 3.10.0, last published: 21 days ago. Start using @docusaurus/theme-live-codeblock in your project by running `npm i @docusaurus/theme-live-codeblock`. There are 11 other projects in the npm registry using @docusaurus/theme-live-codeblock.
      » npm install @docusaurus/theme-live-codeblock
    
Published: Apr 07, 2026
Version: 3.10.0
🌐
CloudCannon
cloudcannon.com › documentation › articles › snippets-using-docusaurus-components
Snippets using Docusaurus Components | CloudCannon Documentation
With the Admonition snippet you can use Docusaurus admonition syntax to highlight rich content in the Content Editor. ... The Code Block snippet allows you to create Docusaurus code blocks with syntax highlighting, titles, and line numbers.
🌐
Medium
medium.com › @techwritershub › interactive-documentation-using-docusaurus-live-code-editor-feature-8951bb99df1a
Interactive Documentation Using Docusaurus Live Code Editor Feature | by TechWriters Hub | Medium
June 25, 2024 - It’s a special block that can display various notes, such as warnings, tips, notes, and info. In Docusaurus, the types of admonitions you can use are: ... To use this admonition, wrap your content in three colons followed by the type of admonition.
🌐
Hasura
hasura.io › docusaurus mdx guide › code blocks
Code Blocks | Hasura DDN Docs
Docusaurus uses prisma under the hood for code-block syntax highlighting.
Find elsewhere
🌐
Quarto
quarto.org › docs › output-formats › docusaurus.html
Docusaurus – Quarto
Note that HTML produced by computations (e.g. a Pandas data frame displayed in a notebook) often use raw HTML with class and/or style tags. This computational output is automatically included in a raw ```{=html} code block so that it renders correctly in Docusaurus.
🌐
Docusaurus
v1.docusaurus.io › docs › en › doc-markdown
Markdown Features · Docusaurus
July 20, 2020 - In your markdown file, insert a line with the text <AUTOGENERATED_TABLE_OF_CONTENTS>. Write your documentation using h3 headers for each function inside a code block. These will be found by Docusaurus and a list of links to these sections will ...
🌐
GitHub
github.com › facebook › docusaurus › blob › main › website › docs › guides › markdown-features › markdown-features-code-blocks.mdx
docusaurus/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx at main · facebook/docusaurus
Every magic comment entry will contain three keys: className (required), line, which applies to the directly next line, or block (containing start and end), which applies to the entire block enclosed by the two comments. Using CSS to target the class can already do a lot, but you can unlock the full potential of this feature through swizzling. npm run swizzle @docusaurus/theme-classic CodeBlock/Line
Author: facebook
🌐
Saucelabs
opensource.saucelabs.com › docusaurus-theme-github-codeblock
Docusaurus Theme GitHub Codeblock | docusaurus-theme-github-codeblock
A Docusaurus v2 plugin that supports referencing code examples from public GitHub repositories.
Starred by 105 users
Forked by 19 users
Languages: TypeScript 51.5% | JavaScript 39.4% | CSS 9.1%
🌐
StudyRaid
app.studyraid.com › en › read › 12346 › 398574 › adding-code-blocks-with-syntax-highlighting
Understand adding code blocks with syntax highlighting
January 25, 2025 - While functional, this basic approach lacks advanced features needed for professional documentation. Docusaurus enhances this foundation through MDX integration and specialized components. For greater control over code presentation, Docusaurus provides a dedicated CodeBlock component.
🌐
Jasny
jasny.net › code blocks
Code Blocks | docusaurus-plugin-gitbook - Arnold Daniels
Code blocks with titles allow you to label your code snippets with filenames or descriptions. ... interface Config { apiUrl: string; timeout: number; debug: boolean; } const config: Config = { apiUrl: 'https://api.example.com', timeout: 5000, debug: false, }; export default config; ... export default { title: 'My Site', url: 'https://example.com', plugins: ['docusaurus-plugin-gitbook'], };