ExpansionPanelHeader
Clickable header button with expand/collapse icon, prepend/append slots and ripple support. Carries aria-expanded and aria-controls.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-expansion-panel-header> — 5 internal parts. Root ① is rendered as a <button> with aria-expanded and aria-controls. The overlay ② covers the entire button for hover/focus state painting.- 1.origam-expansion-panel-header
- Root button element. Carries aria-expanded, aria-controls, tabindex and the ripple directive.
- 2.origam-expansion-panel-header__overlay
- Absolutely positioned overlay for hover/focus state painting. Opacity is 0 at rest, increases on hover and focus-visible.
- 3.origam-expansion-panel-header__prepend
- Leading area hosting prependAvatar or prependIcon. Emits click:prepend when clicked.
- 4.origam-expansion-panel-header__title
- Title text span. Hosts the default slot or the title prop value.
- 5.origam-expansion-panel-header__append
- Trailing area hosting appendAvatar, appendIcon, and the expand/collapse icon. Emits click:append when clicked.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- Icon displayed in the append area when the panel is collapsed.
- Icon displayed in the append area when the panel is expanded.
- hideActionsbooleanfalse
- Hides the expand/collapse icon in the append area.
- focusablebooleantrue
- When true, the header button is focusable and shows an overlay on focus.
- staticbooleanfalse
- Renders the header in static mode — clicking does not toggle the panel. The static class modifier is applied.
- readonlybooleanfalse
- Prevents click interactions without disabling the button visually. The panel state cannot be toggled.
- titlestring
- Header title text rendered in the middle area. Can be replaced by the default slot.
- color
- Foreground colour applied to the header text and icons.
- bgColor
- Background colour of the header button surface.
- tagstring'button'
- HTML element rendered at the header root. Defaults to button for accessibility.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- Header density: compact, comfortable or default.
- Border-radius applied to the header button. Inherits from the parent panel by default.
- 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>none
- Border shorthand applied to the header. Defaults to none.
- 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
- appendAvatarstring
- Image URL for an avatar shown in the trailing area.
- appendIcon
- MDI icon shown in the trailing (append) area after the expand/collapse icon.
- prependAvatarstring
- Image URL for an avatar shown in the leading area before the title.
- prependIcon
- MDI icon shown in the leading (prepend) area before the title.
- prependAriaLabelstring
- appendAriaLabelstring
- rippleboolean | { class: string }true
- Material ripple effect on the header click. Set to false to disable.
- activeboolean | IStateEffectConfig
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
- fontSizeTFontSize
- lineHeightTLineHeight
API
Slots
Emplacements de contenu exposés par ce composant.
- #prepend
- Leading area before the title. Defaults to prependAvatar / prependIcon.
- #title
- #default
- Replaces the title text. Receives the current expand/collapse state and icon props.
- #append
- Trailing area after the title. Defaults to appendAvatar / appendIcon followed by the expand/collapse icon.
API
Emits
Événements émis par ce composant.
- @click:appendMouseEvent
- Fired when the append area (icon or avatar) is clicked.
- @click:prependMouseEvent
- Fired when the prepend area (icon or avatar) is clicked.
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 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.
- Font size of the header title text (15px).
- Font weight of the header title text.
- Line height of the header button.
- Minimum height of the header at rest.
- Border-radius inherited from the parent panel.
- Top and bottom padding of the inner wrapper row.
- Leading and trailing padding of the inner wrapper row.
- Base opacity of the state overlay. Increases to ~0.04 on hover and ~0.12 on focus-visible.
- Overlay opacity when the header is focused (focus-visible).
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | Action |
|---|---|
| Enter / Space | Toggles the parent panel expanded/collapsed when focus is on the header button. |
| Tab | Moves focus to the next interactive element. |
Notes
- The header button carries aria-expanded="true|false" reflecting the current panel selection state.
- The header button carries aria-controls pointing to the content region ID (expansion-panel-content-{id}).
- Disabled panels apply tabindex="-1" and the disabled HTML attribute to the header button. Pointer events are removed.
- When readonly is true, clicks are intercepted but not propagated — the button remains focusable and receives keyboard events without toggling.
- The ripple directive provides a visual affordance for click interactions that supplements focus-visible styling.
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.
- dimension0.9375rem
- Header title font size (15px).
- dimension48px
- Header minimum height at rest.
- dimension64px
- Header minimum height when panel is expanded.
- dimensionvar(--origam-space---4)
- Top and bottom padding of the wrapper row (16px).
- dimensionvar(--origam-space---6)
- Leading and trailing padding of the wrapper row (24px).
- numbervar(--origam-opacity---0)
- Base overlay opacity on hover (resolved via scoped style to 0.04).
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 header with title
Prepend icon
Custom expand / collapse icons
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.