Skip to content

Commit eda3e3b

Browse files
committed
add code group dropdowns
1 parent 4a2308e commit eda3e3b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

components/code-groups.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,32 @@ class HelloWorld {
2828

2929
</CodeGroup>
3030

31+
### Dropdown
32+
33+
You can also show a dropdown button to toggle the code groups with languages as the options.
34+
35+
<CodeGroup dropdown>
36+
37+
```javascript helloWorld.js
38+
console.log("Hello World");
39+
```
40+
41+
```python hello_world.py
42+
print('Hello World!')
43+
```
44+
45+
```java HelloWorld.java
46+
class HelloWorld {
47+
public static void main(String[] args) {
48+
System.out.println("Hello, World!");
49+
}
50+
}
51+
```
52+
53+
</CodeGroup>
54+
55+
56+
3157
<RequestExample>
3258

3359
````mdx Code Group Example
@@ -53,3 +79,10 @@ class HelloWorld {
5379
````
5480

5581
</RequestExample>
82+
83+
### Props
84+
85+
<ResponseField name="dropdown" type="boolean">
86+
Whether to show a dropdown button to toggle the code groups with languages as the options.
87+
</ResponseField>
88+

0 commit comments

Comments
 (0)