Surfaces
Accordion
Vertically stacked collapsible sections backed by Bits UI, with one or many items open at once.
<script>
import { Accordion, AccordionItem } from "@codeatlasdev/ui";
</script>
<Accordion type="single">
<AccordionItem value="a" title="Question">Answer</AccordionItem>
</Accordion>
Triggers are buttons with aria-expanded, and Arrow, Home and End keys move between them. With type="single" the bound value is a string, with type="multiple" it is a string array.
Single
Only one item is open at a time. Clicking the open item collapses it.
Liquid Glass is a design language that applies real-time backdrop blur, refraction and
tinting to UI surfaces, creating depth without heavy visual weight.
All modern evergreen browsers. Older environments receive a fallback without the blur effect.
Yes. Both components use isolation: isolate to keep stacking contexts correct.
Code
Multiple
Several items can be open at once.
Runes replace reactive declarations with explicit $state(), $derived() and $effect().
Bits UI provides unstyled, accessible headless primitives for Svelte, with WAI-ARIA
patterns built in.
All --ca-* tokens are set in global.css and cascade into every component without runtime
overhead.
Code
Controlled
Bind `value` to read or set the open item.
Opened from the bound value.
Opening this one closes the first.
Open item: c1
Code
Accordion props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'single' | 'multiple' | 'single' | Whether one or many items can be open. |
value | string | string[] | undefined | Open item value(s). Bindable. |
onValueChange | (value: string | string[]) => void | undefined | Called when the open items change. |
class | string | '' | Extra class names on the root. |
children | Snippet | undefined | `AccordionItem` children. |
AccordionItem props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | – | Unique key of the item. Required. |
title | string | – | Trigger label. Required. |
class | string | '' | Extra class names. |
children | Snippet | undefined | Body shown when expanded. |