ExpansionPanelHeader
Clickable header button with expand/collapse icon, prepend/append slots and ripple support. Carries aria-expanded and aria-controls.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @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
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 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.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
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.
- 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).
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 header with title
Prepend icon
Custom expand / collapse icons
Ecosystem
Family
Components from the same folder that share conventions and often compose together.