Collapsible

Shows and hides a section with one trigger, such as "Show 3 more" or "Advanced options".
Stable
Web
iOS
Android
@advui/core
Source

Show more

Ada starred 3 repositories
advui/core

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Button, Collapsible } from '@advui/core'

<Collapsible>
  <Collapsible.Trigger>
    <Button variant="ghost">Advanced options</Button>
  </Collapsible.Trigger>
  <Collapsible.Content>…</Collapsible.Content>
</Collapsible>

Examples

Advanced options

Controlled, with a chevron that follows the state.

API reference

Collapsible

The root; accepts layout props such as `gap`.
PropTypeDefaultDescription
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial state when uncontrolled.
onOpenChange(open: boolean) => void—Called on toggle.
disabledbooleanfalseThe trigger does nothing and is announced as unavailable.

Collapsible.Trigger

Wraps one pressable, usually a Button, and adds `aria-expanded` and `aria-controls`.
PropTypeDefaultDescription
children requiredReactElement—The pressable.

Collapsible.Content

The section. It stays mounted while closed, so text typed inside survives.

Accessibility

  • The trigger keeps its own role and name, and gets aria-expanded and aria-controls pointing at the content (the disclosure pattern).
  • Closed content is hidden from screen readers and the tab order.
  • An icon-only trigger needs an aria-label that says what it reveals.
Keyboard interactions
KeyAction
Enter / SpaceToggles the section from the trigger.

Platform notes

Web
The trigger is whatever element you pass, usually a <button>.
iOS
VoiceOver reads the trigger as expanded or collapsed.
Android
TalkBack reads the trigger as expanded or collapsed.
Since v0.3.0Last updated Nov 2, 2026Edit this page on GitHub