ZuploZuplo
LoginSign Up
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
    IntroductionLocal DevelopmentUpdating VersionsNode Modules & Customization
    Configuration
    Writing
    OpenAPI
    Authentication
    Integrations
    Guides
    Extending
    Components
      General
      Documentation
        CodeTabsMermaidAPI PlaygroundSecretStepperSyntax Highlight
      Form
      Utility
Monetization
Deploying & Source Control
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Documentation

CodeTabs

A tabbed code block component that groups multiple code blocks into a single unified view. Useful for showing the same example in different languages or alternative commands for different package managers.

In MDX, the CodeTabs component is available by default and doesn't need an explicit import.

Usage

Wrap multiple fenced code blocks with <CodeTabs> and they will render as tabs. Tab labels are automatically inferred from the code block language.

MDXCode
<CodeTabs> ```ts const greeting: string = "Hello, world!"; console.log(greeting); ``` ```js const greeting = "Hello, world!"; console.log(greeting); ``` ```py greeting = "Hello, world!" print(greeting) ``` </CodeTabs>

Custom Labels

Use the title meta attribute on each code block to set a custom tab label. This is especially useful when multiple code blocks share the same language.

MDXCode
<CodeTabs> ```sh title="pnpm" icon="pnpm" pnpm add zudoku ``` ```sh title="npm" icon="npm" npm install zudoku ``` ```sh title="yarn" icon="yarn" yarn add zudoku ``` </CodeTabs>

Synced Tabs

Use the syncKey prop to keep multiple CodeTabs instances in sync. When a user selects a tab in one group, all groups with the same syncKey update to match. The selection is persisted to localStorage and synced across browser tabs.

MDXCode
<CodeTabs syncKey="package-manager"> ```sh title="pnpm" icon="pnpm" pnpm add zudoku ``` ```sh title="npm" icon="npm" npm install zudoku ``` </CodeTabs> <!-- repeat above -->

Programmatic Usage

Usually it's recommended to use fenced code blocks in MDX files. However, when building reusable components (e.g. in your MDX component config), fenced code blocks aren't processed by the MDX pipeline. Use CodeTabPanel directly instead:

Code
import { CodeTabs, CodeTabPanel } from "zudoku/ui/CodeTabs"; const InstallTabs = ({ pkg }: { pkg: string }) => ( <CodeTabs syncKey="package-manager"> <CodeTabPanel language="sh" title="pnpm" icon="pnpm" code={`pnpm add ${pkg}`} /> <CodeTabPanel language="sh" title="npm" icon="npm" code={`npm install ${pkg}`} /> <CodeTabPanel language="sh" title="yarn" icon="yarn" code={`yarn add ${pkg}`} /> </CodeTabs> );

CodeTabPanel Props

PropTypeDescription
codestringThe code content to display. Required.
languagestringLanguage for syntax highlighting and label inference.
titlestringCustom tab label. Falls back to language.
iconstringOverride the language icon (e.g. "pnpm", "npm").
metastringRaw meta string like in code blocks (e.g. "showLineNumbers").

Props

PropTypeDescription
syncKeystringSync selected tab across all CodeTabs with the same key. Persisted to localStorage and across tabs.
hideIconbooleanHide the language icon in tabs. Defaults to false.
Edit this page
Last modified on May 29, 2026
TypographyMermaid
On this page
  • Usage
  • Custom Labels
  • Synced Tabs
  • Programmatic Usage
    • CodeTabPanel Props
  • Props
const greeting: string = "Hello, world!"; console.log(greeting);
pnpm add zudoku
pnpm run build
pnpm run build
React