ExpansionPanels
Container managing a group of ExpansionPanel items. Supports accordion, flat, popout and inset display modes. Props cascade to all child panels via DefaultsProvider.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-expansion-panels>. The root ① is a flex container wrapping all child panels ②. Mode modifiers (accordion, flat, popout, inset) are applied as root class modifiers.- 1.origam-expansion-panels
- Root flex container. Wraps all panels. Mode modifier classes (--accordion, --flat, --popout, --inset) control layout and border-radius of children.
- 2.origam-expansion-panel (child)
- Each OrigamExpansionPanel child. Border-radius is managed by the parent's CSS selectors (:first-child, :last-child) for mode-specific shapes.
API
Props
All props accepted by this component, with their type, default value and description.
- flatbooleanfalse
- Removes the shadow and the border separator between panels.
- itemsArray<IExpansionPanelProps>
- Data-driven array of panel definitions. Each item is spread as props onto an OrigamExpansionPanel instance.
- accordionbooleanfalse
- Collapses all other panels when one is opened (single-open mode). Panels are rendered without gaps and border-radius is managed per position.
- popoutbooleanfalse
- Active panel expands horizontally beyond the container width, creating a popout effect.
- insetbooleanfalse
- Active panel shrinks horizontally to sit inside the container, creating an inset effect.
- Icon passed down to every child panel header for the collapsed state.
- Icon passed down to every child panel header for the expanded state.
- hideActionsbooleanfalse
- Passed down to every child panel header to hide the expand/collapse icon.
- color
- Foreground colour cascaded to all child panels.
- bgColor
- Background colour cascaded to all child panels.
- tagstring'div'
- HTML element rendered at the panels container root.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- disabledboolean
- modelValueany
- Active panel value(s). Bound to v-model. Array for multiple, single value for one.
- multiplebooleanfalse
- Allows multiple panels to be expanded simultaneously.
- mandatorybooleanfalse
- At least one panel must remain open. "force" prevents deselection even if the same item is clicked.
- maxnumber
- selectedClassstring
- Cascaded density to all child panels: compact, comfortable or default.
- Border-radius of the container and cascaded to all child panels.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- 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
- eagerbooleanfalse
- When true, all panel content is rendered on mount even if collapsed.
- Shows a progress loader on the panels container.
- loadingTextstring
- elevationTElevation
- Box-shadow elevation of the panels container.
- activeboolean | IStateEffectConfig
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
API
Slots
Content slots exposed by this component.
- #default
- Default slot for manual <origam-expansion-panel> children. Used when items prop is not provided.
- #item
- Overrides the default panel rendering for all data-driven items.
- #item.{index}
- Overrides the rendering of a specific panel at the given index.
- #header
- Replaces the header inside all data-driven panels.
- #prepend
- Leading slot for all data-driven panel headers.
- #title
- Title slot for all data-driven panel headers.
- #append
- Trailing slot for all data-driven panel headers.
- #wrapper
- Replaces the content wrapper for all data-driven panels.
- #content
- Body content slot for all data-driven panels.
API
Emits
Events emitted by this component.
- @update:modelValueany
- Fired when the active panel selection changes. Carries the new value or array of values.
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 child 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.
- Width of inactive panels in popout mode.
- Width of the active panel in popout mode.
- Width of inactive panels in inset mode.
- Width of the active panel in inset mode.
- Transition duration for the header overlay border-radius animation in accordion mode.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between panel headers in sequence. |
Notes
- The container manages group selection state and propagates it to child panels via inject/provide. Each panel header receives aria-expanded and aria-controls independently.
- Visual props (density, color, bgColor, rounded, border) are cascaded via OrigamDefaultsProvider so all child panels share the same visual treatment without per-panel repetition.
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.
- dimensioncalc(100% - 32px)
- Inactive panel width in popout mode.
- dimensioncalc(100% + 16px)
- Active panel width in popout mode.
- dimensioncalc(100% - 32px)
- Active panel width in inset mode.
- durationvar(--origam-motion__duration---slow)
- Transition duration for border-radius animation in accordion header overlay.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic group
Accordion (single open)
Data-driven via items prop
Ecosystem
Family
Components from the same folder that share conventions and often compose together.