Surfaces
Accordion
Vertically stacked collapsible sections 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. Arrow Up, Arrow Down, Home and End move focus between the enabled triggers, and every trigger stays in the tab order. 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 the opt-in look of the kit: backdrop blur, refraction and tinting on
surfaces. The default theme is solid.
All modern evergreen browsers. Older environments receive a fallback without the blur effect.
Yes. A Card is a Surface, so any Surface can sit inside it.
Code
Multiple
Several items can be open at once.
Runes replace reactive declarations with explicit $state(), $derived() and $effect().
Unstyled, accessible primitives with the 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): a string for `single` (`''` when none is open), an array for `multiple`. 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. |