ExpansionPanel

Layout & Structure
stable

Collapsible panel with animated header and content reveal. Supports accordion, popout and inset layout modes; optional loader, ripple and density controls.

Aperçu

Rendu de l’aperçu en cours…

default

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamExpansionPanelSchematic of the ExpansionPanel component with 5 numbered internal parts. origam-expansion-panel-header (button) origam-expansion-panel-content (role=region) 1 2 3 4
Anatomy of <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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

tag
string
'div'
HTML element rendered at the panel root.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
density
'default'
Header density: compact, comfortable or default.
color
Foreground colour for the panel header and content.
bgColor
Background colour of the panel surface.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
elevation
TElevation
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.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
value
any
Panel identifier used by the parent group to track selection. Auto-generated when omitted.
disabled
boolean
false
Disables the panel header interaction. Sets aria-disabled and removes pointer events.
selectedClass
string
expandIcon
'mdi-chevron-down'
Icon shown in the header when the panel is collapsed.
collapseIcon
'mdi-chevron-up'
Icon shown in the header when the panel is expanded. Falls back to expandIcon with a 180deg rotation when not set.
hideActions
boolean
false
Hides the expand/collapse icon in the header.
focusable
boolean
true
Allows the header button to receive keyboard focus. Set to false only in non-interactive layouts.
static
boolean
false
Renders the header without expand/collapse behaviour — used to embed the panel inside custom workflows.
readonly
boolean
false
Makes the panel non-interactive without disabling it visually.
title
string
Panel header title text. Can also be set via the #title slot.
appendAvatar
string
appendIcon
TIcon
prependAvatar
string
prependIcon
TIcon
prependAriaLabel
string
appendAriaLabel
string
ripple
boolean | { class: string }
true
Material ripple on the header click. Set to false to disable.
active
boolean | IStateEffectConfig
activeClass
string
hover
boolean | IStateEffectConfig
hoverClass
string
fontSize
TFontSize
lineHeight
TLineHeight
content
string | Component
Content rendered inside the panel body. Accepts a plain string or a Vue component reference. Superseded by the default slot.
eager
boolean
false
When true, renders content immediately even when collapsed. Useful for SEO or when content must be mounted before first expand.
loading
false
Shows a progress loader at the top of the panel. Supports line, circular and skeleton modes.
loadingText
string

API

Slots

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

@group:selected
{ value: boolean }
Fired when the panel selection state changes inside its parent group.

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<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.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

button
region

Interactions clavier

Interactions clavier
ToucheAction
Enter / SpaceToggles the panel expanded/collapsed when focus is on the header button.
TabMoves 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.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
color
var(--origam-color__surface---raised)
Panel background — raised surface.
dimension
var(--origam-radius---sm)
Panel corner radius.
duration
var(--origam-motion__duration---slow)
Transition duration for expand/collapse animations.
dimension
var(--origam-space---4)
Margin above active panels (16px).
dimension
48px
Header minimum height at rest.
dimension
64px
Header minimum height when panel is expanded.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Sous-partie interne : elle est injectée par son composant parent et ne peut pas se rendre seule. Voir la fiche du composant parent pour un exemple vivant.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Basic accordion

vue

Accordion mode (single open)

vue

Data-driven via items prop

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.