A vertically stacked set of interactive headings that reveal content areas. Plays expand and collapse sounds.
A vertically stacked set of interactive headings that reveal content areas. The sensory-ui Accordion plays distinct sounds when items expand and collapse, reinforcing the spatial movement of content.
Pattern: Expand / collapse
npx shadcn@latest add SatyamVyas04/sensory-ui/sensory-ui-accordionimport {
Accordion,
AccordionItem,
AccordionTrigger,
AccordionContent,
} from "@/components/ui/sensory-ui/accordion";| Prop | Type | Default | Description |
|---|---|---|---|
expandSound | SoundRole | false | "overlay.expand" | Sound played when an item expands. |
collapseSound | SoundRole | false | "overlay.collapse" | Sound played when an item collapses. |
volume | number | 1 | Per-component volume multiplier (0–1). |
overlay.expand on expand, overlay.collapse on collapse.
<Accordion type="single" collapsible>
<AccordionItem value="item-1">
<AccordionTrigger>Is it accessible?</AccordionTrigger>
<AccordionContent>
Yes. It adheres to the WAI-ARIA design pattern.
</AccordionContent>
</AccordionItem>
</Accordion><Accordion
type="single"
collapsible
expandSound="interaction.confirm"
collapseSound="interaction.subtle"
volume={0.8}
>
{/* ... */}
</Accordion><Accordion type="single" collapsible expandSound={false} collapseSound={false}>
{/* ... */}
</Accordion><Accordion type="multiple" expandSound="interaction.tap" collapseSound="interaction.subtle">
<AccordionItem value="faq-1">
<AccordionTrigger>What is sensory-ui?</AccordionTrigger>
<AccordionContent>A sound layer for shadcn/ui components.</AccordionContent>
</AccordionItem>
</Accordion><Accordion type="single" expandSound="overlay.expand" collapseSound="overlay.collapse">
{/* Collapsible settings sections */}
</Accordion>| Prop | Value |
|---|---|
expandSound | "overlay.expand" |
collapseSound | "overlay.collapse" |
volume | 1 |
type | "single" |
collapsible | true |
| Situation | Recommended Sound | Why |
|---|---|---|
| FAQ sections | overlay.expand / overlay.collapse | Default: clear spatial cue |
| Settings panels | interaction.tap / interaction.subtle | Lighter, less prominent |
| Navigation menus | navigation.forward / navigation.backward | Directional movement |
| Feature reveals | interaction.confirm / interaction.subtle | Positive reveal, gentle close |
| Event | Default Sound |
|---|---|
| Item expands | overlay.expand |
| Item collapses | overlay.collapse |
View the original Accordion documentation.