Skip to content

Commit 315e902

Browse files
docs: initial accordion docs changes
1 parent b43ee97 commit 315e902

File tree

1 file changed

+70
-5
lines changed
  • apps/website/src/routes/docs/headless/accordion

1 file changed

+70
-5
lines changed

apps/website/src/routes/docs/headless/accordion/index.mdx

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,84 @@ A set of interactive sections that show or hide connected information.
1414

1515
<Showcase name="hero" />
1616

17-
## Initial Value
17+
<FeatureList
18+
features={[
19+
'Follows the WAI-Aria design pattern',
20+
'Full keyboard navigation',
21+
'Can open one or multiple items at a time',
22+
'Supports initial and reactive values',
23+
]}
24+
/>
25+
26+
## Building blocks
27+
28+
<CodeSnippet name="building-blocks.tsx" />
29+
30+
### 🎨 Anatomy
31+
32+
<AnatomyTable
33+
propDescriptors={[
34+
{
35+
name: 'Accordion.Root',
36+
description: 'The primary container for the accordion.',
37+
},
38+
{
39+
name: 'Accordion.Item',
40+
description: 'A single disclosure widget.',
41+
},
42+
{
43+
name: 'Accordion.Header',
44+
description: 'The heading element of an accordion item.',
45+
},
46+
{
47+
name: 'Accordion.Trigger',
48+
description: 'Activates to show or hide the accordion content.',
49+
},
50+
{
51+
name: 'Accordion.Content',
52+
description: 'Displays the content when its connected trigger is actived.',
53+
},
54+
]}
55+
/>
56+
57+
## Why use a headless accordion?
58+
59+
While you can create a native disclosure with HTML elements like `details` and `summary`, there are some limitations and issues with them.
60+
61+
### Native disclosure pain points
62+
63+
<FeatureList
64+
issues={[
65+
'Cannot control multiple disclosures at once',
66+
'Inconsistent accessible name computation',
67+
'Unintuitive role announcements',
68+
'Connected information is hard to find with AT',
69+
]}
70+
/>
71+
72+
Qwik UI includes a headless Accordion component that uses ARIA and JavaScript to enhance accessibility and usability for managing multiple sections smoothly.
73+
74+
> For more information on the inconsistencies of these native elements, see Scott O'Hara's [The details and summary elements, again](https://www.scottohara.me/blog/2022/09/12/details-summary.html) article.
75+
76+
## Component State
77+
78+
## Initial value
1879

1980
<Showcase name="initial" />
2081

21-
## Reactive
82+
## Reactive value
2283

2384
<Showcase name="reactive" />
2485

25-
## Programmatic
86+
## Programmatic changes
2687

2788
<Showcase name="programmatic" />
2889

29-
## Handle Change
90+
## Handling selection changes
3091

3192
<Showcase name="on-change" />
3293

33-
## Disabled
94+
## Disabled items
3495

3596
<Showcase name="disabled" />
3697

@@ -45,3 +106,7 @@ A set of interactive sections that show or hide connected information.
45106
## Dynamic
46107

47108
<Showcase name="dynamic" />
109+
110+
## Example CSS
111+
112+
<CodeSnippet name="accordion.css" />

0 commit comments

Comments
 (0)