An interactive component which expands and collapses a panel. Plays expand and collapse sounds.
An interactive component which expands and collapses a panel. The sensory-ui Collapsible plays distinct sounds for expand and collapse actions, reinforcing the content movement.
Pattern: Open sound / close sound
npx shadcn@latest add SatyamVyas04/sensory-ui/sensory-ui-collapsibleimport {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/sensory-ui/collapsible";| Prop | Type | Default | Description |
|---|---|---|---|
openSound | SoundRole | false | "overlay.expand" | Sound played when expanding. |
closeSound | SoundRole | false | "overlay.collapse" | Sound played when collapsing. |
volume | number | 1 | Per-component volume multiplier (0–1). |
overlay.expand on expand, overlay.collapse on collapse.
<Collapsible>
<CollapsibleTrigger>Toggle</CollapsibleTrigger>
<CollapsibleContent>
Content goes here.
</CollapsibleContent>
</Collapsible><Collapsible openSound="interaction.confirm" closeSound="interaction.subtle">
{/* ... */}
</Collapsible><Collapsible openSound={false} closeSound={false}>
{/* ... */}
</Collapsible><Collapsible openSound="overlay.expand" closeSound="overlay.collapse">
<CollapsibleTrigger>Show filters</CollapsibleTrigger>
<CollapsibleContent>
{/* Filter options */}
</CollapsibleContent>
</Collapsible><Collapsible openSound="interaction.tap" closeSound="interaction.subtle">
<CollapsibleTrigger>Read more</CollapsibleTrigger>
<CollapsibleContent>
{/* Extended content */}
</CollapsibleContent>
</Collapsible>| Prop | Value |
|---|---|
openSound | "overlay.expand" |
closeSound | "overlay.collapse" |
volume | 1 |
| Situation | Recommended Sound | Why |
|---|---|---|
| Filter panels | overlay.expand / overlay.collapse | Clear spatial expansion |
| Read more links | interaction.tap / interaction.subtle | Lighter content reveal |
| Settings sections | overlay.expand / overlay.collapse | Structural movement |
| FAQ items | overlay.expand / overlay.collapse | Consistent with Accordion |
| Event | Default Sound |
|---|---|
| Panel expands | overlay.expand |
| Panel collapses | overlay.collapse |
View the original Collapsible documentation.