Skip to content

Commit 20a8e66

Browse files
authored
update accordion page (#941)
1 parent 14b4c6c commit 20a8e66

File tree

1 file changed

+40
-46
lines changed

1 file changed

+40
-46
lines changed

components/accordions.mdx

Lines changed: 40 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
---
22
title: "Accordions"
3-
description: "A dropdown component to toggle content visibility"
3+
description: "Collapsible components to show and hide content"
44
icon: "chevron-down"
55
---
66

7+
Accordions allow users to expand and collapse content sections. Use accordions for progressive disclosure and to organize information.
8+
9+
## Single accordion
10+
711
<Accordion title="I am an Accordion.">
812
You can put any content in here, including other components, like code:
913
```java HelloWorld.java
@@ -15,9 +19,7 @@ icon: "chevron-down"
1519
```
1620
</Accordion>
1721

18-
<RequestExample>
19-
20-
````mdx Accordion Example
22+
````mdx Accordion example
2123
<Accordion title="I am an Accordion.">
2224
You can put any content in here, including other components, like code:
2325

@@ -31,9 +33,12 @@ icon: "chevron-down"
3133
</Accordion>
3234
````
3335

34-
````mdx Accordion Group Example
36+
## Accordion Groups
37+
38+
Group related accordions together using `<AccordionGroup>`. This creates a cohesive section of accordions that can be individually expanded or collapsed.
39+
3540
<AccordionGroup>
36-
<Accordion title="FAQ without Icon">
41+
<Accordion title="Getting started">
3742
You can put other components inside Accordions.
3843

3944
```java HelloWorld.java
@@ -43,23 +48,42 @@ icon: "chevron-down"
4348
}
4449
}
4550
```
51+
</Accordion>
52+
53+
<Accordion title="Advanced features" icon="bot">
54+
Add icons to make accordions more visually distinct and scannable.
55+
</Accordion>
56+
57+
<Accordion title="Troubleshooting">
58+
Keep related content organized into groups.
59+
</Accordion>
60+
</AccordionGroup>
61+
62+
````mdx Accordion Group Example
63+
<AccordionGroup>
64+
<Accordion title="Getting started">
65+
You can put other components inside Accordions.
4666

47-
Check out the [Accordion](/components/accordions) docs for all the supported props.
67+
```java HelloWorld.java
68+
class HelloWorld {
69+
public static void main(String[] args) {
70+
System.out.println("Hello, World!");
71+
}
72+
}
73+
```
4874
</Accordion>
4975

50-
<Accordion title="FAQ with Icon" icon="alien-8bit">
51-
Check out the [Accordion](/components/accordions) docs for all the supported props.
76+
<Accordion title="Advanced features" icon="alien-8bit">
77+
Add icons to make accordions more visually distinct and scannable.
5278
</Accordion>
5379

54-
<Accordion title="FAQ without Icon">
55-
Check out the [Accordion](/components/accordions) docs for all the supported props.
80+
<Accordion title="Troubleshooting">
81+
Keep related content organized into groups.
5682
</Accordion>
5783
</AccordionGroup>
5884
````
5985

60-
</RequestExample>
61-
62-
### Props
86+
## Properties
6387

6488
<ResponseField name="title" type="string" required>
6589
Title in the Accordion preview.
@@ -75,39 +99,9 @@ icon: "chevron-down"
7599

76100
<ResponseField name="icon" type="string or svg">
77101
A [Font Awesome icon](https://fontawesome.com/icons), [Lucide
78-
icon](https://lucide.dev/icons), or SVG code
102+
icon](https://lucide.dev/icons), or SVG code.
79103
</ResponseField>
80104

81105
<ResponseField name="iconType" type="string">
82-
One of "regular", "solid", "light", "thin", "sharp-solid", "duotone", or
83-
"brands"
106+
For Font Awesome icons, one of "regular", "solid", "light", "thin", "sharp-solid", "duotone", or "brands".
84107
</ResponseField>
85-
86-
## Accordion Groups
87-
88-
You can group multiple accordions into a single display. Simply add `<AccordionGroup>` around your existing `<Accordion>` components.
89-
90-
<AccordionGroup>
91-
<Accordion title="FAQ without Icon">
92-
You can put other components inside Accordions.
93-
94-
```java HelloWorld.java
95-
class HelloWorld {
96-
public static void main(String[] args) {
97-
System.out.println("Hello, World!");
98-
}
99-
}
100-
```
101-
102-
Check out the [Accordion](/components/accordions) docs for all the supported props.
103-
104-
</Accordion>
105-
106-
<Accordion title="FAQ with Icon" icon="bot">
107-
Check out the [Accordion](/components/accordions) docs for all the supported props.
108-
</Accordion>
109-
110-
<Accordion title="FAQ without Icon">
111-
Check out the [Accordion](/components/accordions) docs for all the supported props.
112-
</Accordion>
113-
</AccordionGroup>

0 commit comments

Comments
 (0)