Skip to content

Commit 6fca063

Browse files
docs: rest of accordion docs
1 parent 1c5200a commit 6fca063

File tree

2 files changed

+103
-4
lines changed

2 files changed

+103
-4
lines changed

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

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ A set of interactive sections that show or hide connected information.
1414

1515
<Showcase name="hero" />
1616

17+
## ✨ Features
18+
1719
<FeatureList
1820
features={[
1921
'Follows the WAI-Aria design pattern',
@@ -123,21 +125,23 @@ The component itself can also be disabled by setting the `disabled` prop to true
123125

124126
<Showcase name="disabled-root" />
125127

126-
## Animation
128+
## Advanced
129+
130+
### Animation
127131

128132
Animations can also be added using the `--qwikui-collapsible-content-height` variable.
129133

130134
<Showcase name="animation" />
131135

132136
<CodeSnippet name="animation.css" />
133137

134-
## CSR
138+
### CSR
135139

136140
The Accordion automatically renders based on its environment. This means that it works for both server-side and client-side rendering.
137141

138142
<Showcase name="csr" />
139143

140-
## Dynamic
144+
### Dynamic
141145

142146
You have custom control over how to render items in the Accordion, allowing for dynamic rendering of items.
143147

@@ -148,3 +152,98 @@ You have custom control over how to render items in the Accordion, allowing for
148152
## Example CSS
149153

150154
<CodeSnippet name="accordion.css" />
155+
156+
## Keyboard Interaction
157+
158+
<KeyboardInteractionTable
159+
keyDescriptors={[
160+
{
161+
keyTitle: 'Space',
162+
description: `Expands the content of the focused section.`,
163+
},
164+
{
165+
keyTitle: 'Enter',
166+
description: `Expands the content of the focused section.`,
167+
},
168+
{
169+
keyTitle: 'Tab',
170+
description: `Moves focus to the next element.`,
171+
},
172+
{
173+
keyTitle: 'Shift + Tab',
174+
description: `Moves focus to the previous element.`,
175+
},
176+
{
177+
keyTitle: 'ArrowDown',
178+
description: `Moves focus to the next trigger.`,
179+
},
180+
{
181+
keyTitle: 'ArrowUp',
182+
description: `Moves focus to the previous trigger.`,
183+
},
184+
{
185+
keyTitle: 'Home',
186+
description: `Moves focus to the first trigger.`,
187+
},
188+
{
189+
keyTitle: 'End',
190+
description: `Moves focus to the last trigger.`,
191+
},
192+
]}
193+
/>
194+
195+
## API
196+
197+
### Accordion.Root
198+
199+
<APITable
200+
propDescriptors={[
201+
{
202+
name: 'multiple',
203+
type: 'boolean',
204+
description: 'Allows multiple items to be expanded.',
205+
},
206+
{
207+
name: 'bind:value',
208+
type: 'Signal',
209+
description: 'Reactive signal that controls the selected item.',
210+
},
211+
{
212+
name: 'initialIndex',
213+
type: 'number',
214+
description: 'Index of the initially expanded item.',
215+
},
216+
{
217+
name: 'onChange$',
218+
type: 'function',
219+
description: 'Called when the state changes.',
220+
},
221+
{
222+
name: 'disabled',
223+
type: 'boolean',
224+
description: 'Disables the entire accordion.',
225+
},
226+
{
227+
name: 'collapsible',
228+
type: 'boolean',
229+
description: 'Allows items to be collapsible.',
230+
},
231+
]}
232+
/>
233+
234+
### Accordion.Item
235+
236+
<APITable
237+
propDescriptors={[
238+
{
239+
name: 'value',
240+
type: 'string',
241+
description: 'The value associated with the accordion item.',
242+
},
243+
{
244+
name: 'disabled',
245+
type: 'boolean',
246+
description: 'When true, the accordion item is disabled.',
247+
},
248+
]}
249+
/>

apps/website/src/routes/docs/headless/accordion/snippets/accordion.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
}
119119

120120
.dynamic-input .delete input {
121-
background: hsla(var(--secondary) / 0.2);
121+
background: hsla(var(--accent) / 1);
122122
}
123123

124124
.dynamic-buttons {

0 commit comments

Comments
 (0)