Skip to main content

CodeGroup Component

The CodeGroup component allows you to display multiple code blocks in a tabbed interface. Each code block becomes its own tab, making it easy to showcase different implementations or variations of code.

  1. Wrap your code blocks in the <CodeGroup> component
  2. Each code block inside becomes a separate tab
  3. The component will automatically create a tabbed interface

Example

function greet() {
console.log("Hello world!");
}

Basic Usage

<CodeGroup>

```javascript Node.js
function greet() {
console.log("Hello world!");
}
```

```python Flask
def greet():
print("Hello world!")
```

```java Android
public class Greeting {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
```

</CodeGroup>