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.
- Wrap your code blocks in the
<CodeGroup>
component - Each code block inside becomes a separate tab
- The component will automatically create a tabbed interface
Example
- Node.js
- Flask
- Android
function greet() {
console.log("Hello world!");
}
def greet():
print("Hello world!")
public class Greeting {
public static void main(String[] args) {
System.out.println("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>