ExpansionPanel
Collapsible panel with animated header and content reveal. Supports accordion, popout and inset layout modes; optional loader, ripple and density controls.
Preview
Rendering the live preview…
defaultStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-expansion-panel> — 4 internal parts. The shadow ① is an absolutely-positioned sibling. Header ③ is a <button> with aria-expanded. Content ④ has role="region" and aria-labelledby pointing to the header.- 1.origam-expansion-panel
- Root element. Flex container for shadow, header and content.
- 2.origam-expansion-panel__shadow
- Absolutely positioned shadow layer. Uses box-shadow token. z-index: -1 prevents clipping content.
- 3.origam-expansion-panel__header / origam-expansion-panel-header
- Rendered as a
- 4.origam-expansion-panel__content / origam-expansion-panel-content
- Content region with role="region" and aria-labelledby. Animated via OrigamExpandY transition. Hosts the default slot.
API
Props
All props accepted by this component, with their type, default value and description.
- tagstring'div'
- HTML element rendered at the panel root.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- Header density: compact, comfortable or default.
- color
- Foreground colour for the panel header and content.
- bgColor
- Background colour of the panel surface.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- elevationTElevation
- Box-shadow elevation. The shadow is rendered on a pseudo __shadow element so it does not clip the content.
- Border-radius of the panel. Applied to all four corners; the active panel resets the bottom radius.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- valueany
- Panel identifier used by the parent group to track selection. Auto-generated when omitted.
- disabledbooleanfalse
- Disables the panel header interaction. Sets aria-disabled and removes pointer events.
- selectedClassstring
- Icon shown in the header when the panel is collapsed.
- Icon shown in the header when the panel is expanded. Falls back to expandIcon with a 180deg rotation when not set.
- hideActionsbooleanfalse
- Hides the expand/collapse icon in the header.
- focusablebooleantrue
- Allows the header button to receive keyboard focus. Set to false only in non-interactive layouts.
- staticbooleanfalse
- Renders the header without expand/collapse behaviour — used to embed the panel inside custom workflows.
- readonlybooleanfalse
- Makes the panel non-interactive without disabling it visually.
- titlestring
- Panel header title text. Can also be set via the #title slot.
- appendAvatarstring
- appendIconTIcon
- prependAvatarstring
- prependIconTIcon
- prependAriaLabelstring
- appendAriaLabelstring
- rippleboolean | { class: string }true
- Material ripple on the header click. Set to false to disable.
- activeboolean | IStateEffectConfig
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
- fontSizeTFontSize
- lineHeightTLineHeight
- contentstring | Component
- Content rendered inside the panel body. Accepts a plain string or a Vue component reference. Superseded by the default slot.
- eagerbooleanfalse
- When true, renders content immediately even when collapsed. Useful for SEO or when content must be mounted before first expand.
- Shows a progress loader at the top of the panel. Supports line, circular and skeleton modes.
- loadingTextstring
API
Slots
Content slots exposed by this component.
- #loader
- Custom loader shown at the top of the panel when loading is active.
- #header
- Replaces the entire OrigamExpansionPanelHeader with custom markup.
- #prepend
- Leading area of the header (before the title). Typically an icon or avatar.
- #title
- Replaces the title text inside the header. Receives expand() method and isSelected boolean.
- #append
- Trailing area of the header (after expand/collapse icon).
- #wrapper
- Replaces the entire OrigamExpansionPanelContent wrapper.
- #default
- Panel body content rendered inside OrigamExpansionPanelContent.
API
Emits
Events emitted by this component.
- @group:selected{ value: boolean }
- Fired when the panel selection state changes inside its parent group.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Filters and forwards a subset of props to header/content sub-components.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Panel corner radius. Reset to 0 on inner panels in accordion/flat mode.
- Transition duration for margin, radius and max-width changes on expand/collapse.
- Margin applied above an active panel (and the panel following it) to visually separate it from siblings.
- Colour of the ::after separator line between panels (non-accordion mode).
- Opacity of the ::after separator. Fades to 0 adjacent to active panels.
- Box shadow of the elevation pseudo-element.
- Header minimum height at rest. Increases to 64px when the panel is active.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Enter / Space | Toggles the panel expanded/collapsed when focus is on the header button. |
| Tab | Moves focus to the next interactive element (next header or content). |
Notes
- The header button carries aria-expanded="true|false" reflecting the current panel state. Screen readers announce the expanded/collapsed status.
- The header button carries aria-controls pointing to the content region ID. The content region carries aria-labelledby pointing to the header ID.
- Disabled panels use tabindex="-1" on the header and add aria-disabled via the disabled HTML attribute.
- The expand/collapse animation respects prefers-reduced-motion: the transition-duration is overridden to 0ms.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- colorvar(--origam-color__surface---raised)
- Panel background — raised surface.
- dimensionvar(--origam-radius---sm)
- Panel corner radius.
- durationvar(--origam-motion__duration---slow)
- Transition duration for expand/collapse animations.
- dimensionvar(--origam-space---4)
- Margin above active panels (16px).
- dimension48px
- Header minimum height at rest.
- dimension64px
- Header minimum height when panel is expanded.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
This is an internal sub-part: it is injected by its parent component and cannot render on its own. See the parent component page for a live example.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic accordion
Accordion mode (single open)
Data-driven via items prop
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
ExpansionPanels
Container managing a group of ExpansionPanel items. Supports accordion, flat, popout and inset display modes.
ExpansionPanelHeader
Clickable header row with expand/collapse icon, prepend/append slots and ripple support.
ExpansionPanelContent
Animated content region revealed when the panel is expanded. Has role="region" and aria-labelledby pointing to the header.