Skip to content
Alea0.1

Navigation

Collapsible

One section that opens and closes, lighter than an accordion: advanced options, details, a long list.

Ant Design: Collapse ghost

import { Collapsible } from '@alea/ui';

Examples

Advanced options

Lighter than an accordion: a trigger and its panel.

Props

Collapsible props

One section that opens and closes, without the card look of an accordion (shadcn Collapsible, Ant Collapse ghost).

PropTypeDefaultDescription
childrenrequiredReactNode-The content that opens and closes.
titlerequiredReactNode-The always-visible trigger text.
classNamestring-
defaultExpandedboolean-Open to start with.
isExpandedboolean-Open (controlled).
onExpandedChange((open: boolean) => void)-Called when it opens or closes.

Accessibility

  • A button with aria-expanded controls the panel; the panel animates to its height (expand pattern).

Keyboard

KeyDoes
Enter or SpaceOpens or closes

Do and don't

Do

  • Name the trigger after what it reveals (Advanced options).

Don't

  • Don't hide required fields in it.
Tested with axe, keyboard and screen reader roles