|
1 | 1 | ---
|
2 | 2 | title: 'Accordion Groups'
|
3 |
| -description: Display expandable/collapsible options that can reveal more information |
4 |
| -icon: 'table-rows' |
| 3 | +description: 'Display expandable/collapsible options that can reveal more information' |
5 | 4 | ---
|
6 |
| -<AccordionGroup> |
7 |
| - <Accordion title="Option 1"> |
8 |
| - You can put other components inside Accordions. |
9 | 5 |
|
10 |
| - ```ts index.ts |
11 |
| - export function generateRandomNumber() { |
12 |
| - return Math.random(); |
13 |
| - } |
14 |
| - ``` |
| 6 | +Accordion Groups combine multiple accordions into a single collapsible interface. They maintain consistent styling and behavior while organizing related content into manageable sections. |
15 | 7 |
|
16 |
| - </Accordion> |
| 8 | +## Examples |
17 | 9 |
|
18 |
| - <Accordion title="Option 2"> |
19 |
| - This is a second option. |
| 10 | +<AccordionGroup> |
| 11 | + <Accordion title="Text Example"> |
| 12 | + This is a basic example of an accordion group. |
20 | 13 | </Accordion>
|
21 |
| - |
22 |
| - <Accordion title="Option 3"> |
23 |
| - This is a third option. |
| 14 | + |
| 15 | + <Accordion title="Multimedia Example"> |
| 16 | + You can embed photos, videos, and other media within accordions for rich interactive content. |
| 17 | + |
| 18 | + <embed |
| 19 | + src="./growing-fern.mp4" |
| 20 | + type="video/mp4" |
| 21 | + width="640" |
| 22 | + height="360" |
| 23 | + /> |
24 | 24 | </Accordion>
|
25 |
| -</AccordionGroup> |
26 | 25 |
|
27 |
| -<Aside> |
28 |
| -<CodeBlock title="Markdown"> |
29 |
| -````jsx |
30 |
| -<AccordionGroup> |
31 |
| - <Accordion title="Option 1"> |
32 |
| - You can put other components inside Accordions. |
| 26 | + <Accordion title="Rich Content Support"> |
| 27 | + Accordions can contain rich content including code blocks, callouts, and other components. |
33 | 28 |
|
34 | 29 | ```ts
|
35 |
| - export function generateRandomNumber() { |
36 |
| - return Math.random(); |
| 30 | + // Example of code inside an accordion |
| 31 | + export function greet(name: string) { |
| 32 | + return `Hello, ${name}!`; |
37 | 33 | }
|
38 | 34 | ```
|
39 |
| - |
40 |
| - </Accordion> |
41 |
| - |
42 |
| - <Accordion title="Option 2"> |
43 |
| - This is a second option. |
44 | 35 | </Accordion>
|
45 | 36 |
|
46 |
| - <Accordion title="Option 3"> |
47 |
| - This is a third option. |
| 37 | + <Accordion title="Best Practices Using Accordion Groups"> |
| 38 | + - Use accordion groups when you have multiple related sections |
| 39 | + - Each accordion should have a clear, descriptive title |
| 40 | + - Keep content concise and focused |
48 | 41 | </Accordion>
|
49 | 42 | </AccordionGroup>
|
50 |
| -```` |
51 |
| -</CodeBlock> |
| 43 | + |
| 44 | +<Aside> |
| 45 | + <CodeBlock title="Example Usage"> |
| 46 | + ````jsx |
| 47 | + <AccordionGroup> |
| 48 | + <Accordion title="Text Example"> |
| 49 | + This is a basic example of an accordion group. |
| 50 | + </Accordion> |
| 51 | + |
| 52 | + <Accordion title="Multimedia Example"> |
| 53 | + You can embed photos, videos, and other media within accordions for rich interactive content. |
| 54 | + |
| 55 | + <embed |
| 56 | + src="./growing-fern.mp4" |
| 57 | + type="video/mp4" |
| 58 | + width="640" |
| 59 | + height="360" |
| 60 | + /> |
| 61 | + </Accordion> |
| 62 | + |
| 63 | + <Accordion title="Rich Content Support"> |
| 64 | + Accordions can contain rich content including code blocks, callouts, and other components. |
| 65 | + |
| 66 | + ```ts |
| 67 | + export function greet(name: string) { |
| 68 | + return `Hello, ${name}!`; |
| 69 | + } |
| 70 | + ``` |
| 71 | + </Accordion> |
| 72 | + |
| 73 | + <Accordion title="Best Practices Using Accordion Groups"> |
| 74 | + - Use accordion groups when you have multiple related sections |
| 75 | + - Each accordion should have a clear title |
| 76 | + - Keep content concise and focused |
| 77 | + </Accordion> |
| 78 | + </AccordionGroup> |
| 79 | + ```` |
| 80 | + </CodeBlock> |
52 | 81 | </Aside>
|
0 commit comments