Skip to content

Collapsible

Collapsible

<Collapsible title="Advanced options">
<p>Hidden by default. Click the header to reveal.</p>
</Collapsible>

Install: @helixui/core

import { Collapsible } from '@helixui/core'

status: stable · since: 0.1.0

Tags: disclosure, expand, accordion, show-hide

Anatomy

[▶ Title] ← collapsed
[▼ Title]
<children> ← expanded

Layout

  • displayblock
  • widthfill
  • heightcontent
  • intrinsicSizeheader always visible, body animates open/closed
  • stackabletrue
  • fullBleedfalse

Visual

A header row with a rotating chevron and a body that animates its height when toggled. Header uses font.weight.semibold and a hover surface; body uses default text.

Props

NameTypeDefaultDescription
titleReactNodeHeader label. Required.
isExpandedbooleanControlled expanded state.
defaultExpandedbooleanfalseUncontrolled initial.
onExpandedChange(expanded: boolean) => voidChange handler.
isDisabledbooleanfalseDisables toggling.

Slots

  • children — panel content

Tokens used

color.bg.surface.default, color.bg.action.neutral.default, color.text.primary, color.text.secondary, color.border.default, color.border.focus, radius.md, space.3, space.4, font.family.sans, font.size.md, font.size.sm, font.weight.medium

Accessibility

Notes

  • Built on react-aria-components Disclosure — full ARIA expanded/controls and keyboard handled.
  • For multiple coordinated collapsibles, use DisclosureGroup directly from react-aria-components.

Composes with

ComponentRelationNote
StackparentGroup multiple Collapsibles in a Stack for an accordion.
NavigationMenusibling
Tabssibling

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

FAQ entry

“expandable FAQ question”

<Collapsible title="What is helixui?">
helixui is an AI-friendly design system.
</Collapsible>