AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Display

Collapse

A single expandable panel that hides secondary content until asked.

Examples

Accordion
Surface
Size
Caret
Collapse · accordion · a disabled panel · an extra accessory · click a header
Advanced settings Let participants join anonymously, and shuffle the answer order for every player. Scoring Award points by speed, and show a leaderboard between rounds. Billing (read-only) Managed by your workspace owner.

API

PropTypeDefaultNotes
openbooleanfalseWhether the panel is expanded; toggled on header click (observed → aria-expanded synced)
accordionbooleanfalseOpening this panel closes sibling accordion panels under the same parent (one-open-at-a-time)
ghostbooleanfalseBorderless, transparent surface that sits seamlessly on the page
size'small'Denser header + body padding
icon-position'start' | 'end'startCaret on the leading or trailing edge of the header
disabledbooleanfalseNon-interactive, dimmed panel (observed → aria-disabled synced)
headerslotSectionThe always-visible summary row
extraslotA trailing header accessory (a tag, a count, an icon)
toggleCustomEvent<{open}>Composed event; read e.detail.open

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-collapse';   // registers <aha-collapse>

Agent feed for this component (absolute, fetchable anywhere): collapse.agent.json · collapse.md · collapse.llms.txt

When to use

When to use
  • Collapse — hiding secondary detail (advanced settings, an FAQ answer) until wanted
  • Tabs — switching between peer views of equal importance
  • Card — content that should always be visible
Header text names what's inside — 'Advanced settings', not 'More'. Keep panels shallow; deep nesting hides content people never find.
Surfaces
editor dashboard settings

Spec

Panel border 1px #E3E3E3 · radius 8px · bg #FFFFFF (ghost: borderless, transparent) · Header padding 14/16 · 15/22 SemiBold #1A1A1A · hover #F7F7F7 (small: 8/12 · 14/20) · Caret system-caret-right <aha-icon>, rotate 0°→90° on open, motion-mid ease-in-out · Icon position start (leading, default) or end (trailing edge, via order) · Body grid-rows 0fr→1fr, motion-mid ease-in-out · 14/22 #4A4A4A · Disabled text-disabled #B5B5B5, not-allowed, hover suppressed, aria-disabled