Sets the tab label from the block's metastring and overrides the other sources.
Code Groups
1 min readStableBeginner
The Code Group component organizes multiple code blocks into a tabbed interface. The title from each block's metastring becomes the tab label.
Quick Start
Two package manager options.
npm
Bash
npm install next react react-dompnpm
Bash
pnpm add next react react-domAdding Options
Three options for a common task.
npm
Bash
npm install next react react-domyarn
Bash
yarn add next react react-dompnpm
Bash
pnpm add next react react-domAdvanced
Show the same logic in different languages.
JavaScript
JavaScript
const greeting = 'Hello, World!'
console.log(greeting)Python
Python
greeting = 'Hello, World!'
print(greeting)Go
Go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}Options
The tab label comes from each child code block, resolved in this order:
title(recommended)languagearia-label(with the " code block" suffix stripped)- "Tab N" fallback
titlestringDefault: languageRelated pages
Was this page helpful?