Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions components/code-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@ class HelloWorld {

</CodeGroup>

## Language dropdown

You can replace the tabs in a code group with a dropdown menu to toggle between languages.

<CodeGroup dropdown>

```javascript helloWorld.js
console.log("Hello World");
```

```python hello_world.py
print('Hello World!')
```

```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```

</CodeGroup>

### Props

<ResponseField name="dropdown" type="boolean">
Whether to show a dropdown button to toggle the code groups with languages as the options.
</ResponseField>

<RequestExample>

````mdx Code Group Example
Expand Down