Skip to content

OrigamExpansionPanelContent ​

<OrigamExpansionPanelContent> is the collapsible body of a single <OrigamExpansionPanel>. It renders inside an <OrigamExpandY> transition, so opening and closing animate the region's height.

Runtime requirement — the component injects the panel context published under ORIGAM_EXPANSION_PANEL_KEY by <OrigamExpansionPanel>. Rendered outside one it throws [Origam] expansion-panel-content needs to be placed inside expansion-panel. You rarely mount it yourself: <OrigamExpansionPanel> already renders one, forwarding the content-shaped half of its own props.

Basic usage ​

⛔ Do not nest <origam-expansion-panel-header> / <origam-expansion-panel-content> as plain children of <origam-expansion-panel>. Its default slot is forwarded straight into an auto-generated content region (hasContent = slots.default || !!props.content), and its header only renders when title (or #header/#title/#prepend/#append) is supplied — so raw children like this render neither a header nor a working body. Pass title / content (and this component's other props) directly on <origam-expansion-panel> instead; it forwards them:

vue
<template>
    <origam-expansion-panels>
        <origam-expansion-panel title="Details" content="Panel body."/>
    </origam-expansion-panels>
</template>

Reach for <origam-expansion-panel-content> directly only through the parent's #wrapper scoped slot, when you need full control (a custom #loader, for instance):

vue
<template>
    <origam-expansion-panels>
        <origam-expansion-panel title="Details">
            <template #wrapper="wrapperProps">
                <origam-expansion-panel-content v-bind="wrapperProps" content="Panel body.">
                    <template #loader>
                        <span>Loading…</span>
                    </template>
                </origam-expansion-panel-content>
            </template>
        </origam-expansion-panel>
    </origam-expansion-panels>
</template>

Content — prop or slot ​

content accepts a plain string or a component definition; anything that isn't a string is rendered through <component :is>. The default slot wins over the prop when both are present.

vue
<template>
    <origam-expansion-panel-content>
        <p>Rich body content.</p>
        <ul><li>One</li><li>Two</li></ul>
    </origam-expansion-panel-content>
</template>

Props ​

Content ​

PropTypeDefaultDescription
contentstring | ComponentundefinedBody content. A non-string value is mounted via <component :is>. Ignored when the default slot is filled.
tagstring'div'Element rendered for the content region.

Loading & lazy mount ​

PropTypeDefaultDescription
eagerbooleanundefinedRender the body immediately instead of waiting for the first expand (useLazy). Without it the body mounts on first open and is unmounted again once the collapse transition has finished (onAfterLeave); with it the body is mounted from the start and never unmounted.
loadingboolean | number | TLoaderConfigundefinedLoading state. true → indeterminate; a number 0..100 → determinate; an object { type: 'line' | 'circular' | 'skeleton', … } → explicit renderer plus per-instance overrides. The component's preferred kind is line.
loadingTextstringundefinedLocale key passed as the label of the active loading renderer, which resolves it into its own aria-label (default origam.loading).

While loading is active with kind === 'skeleton', three <origam-skeleton variant="text"> rows replace the body, inside ONE <origam-skeleton-group> (a single role="status" announcement instead of three; the rows are aria-hidden). Any other kind renders an <origam-progress> above the body. Both are replaceable through the loader slot.

Surface ​

PropTypeDefaultDescription
colorTColorundefinedForeground colour.
bgColorTColorundefinedBackground colour.
roundedboolean | number | string | TRoundedundefinedCorner radius.
border, borderTop, borderRight, borderBottom, borderLeft, borderBlock, borderInlineboolean | number | stringundefinedBorder widths, per edge or per axis.
borderColorstringundefinedBorder colour for every edge.
borderStylestringundefinedBorder style (solid, dashed, …).
borderTopColor, borderRightColor, borderBottomColor, borderLeftColorTColorundefinedPer-edge border colour.
densityTDensityundefinedDensity modifier.

Spacing ​

PropTypeDefaultDescription
padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingBlock, paddingInlineboolean | number | stringundefinedPadding on the content region.
margin, marginTop, marginRight, marginBottom, marginLeft, marginBlock, marginInlineboolean | number | stringundefinedMargin on the content region.

Common ​

PropTypeDefaultDescription
idstringgeneratedDOM id of the content region. Published to the sibling header so its aria-controls points at the real id (#519, #520). Falls back to expansion-panel-content-{panelId}.
classstring | string[] | objectundefinedExtra classes on the content region.
stylestring | string[] | object | StyleValueundefinedExtra inline styles.

Emits ​

<OrigamExpansionPanelContent> emits nothing — IExpansionPanelContentEmits is empty. Expand / collapse is owned by the header and the panel group.

Slots ​

SlotScopeDescription
default—Body content. Replaces the content prop.
loader—Replaces the built-in skeleton / progress renderer while loading is active.

Accessibility ​

  • The content region renders role="region" and aria-labelledby="{header id}", read from the shared panel context — the real resolved id, not a guess at the generated naming scheme.
  • Collapsed content is not in the DOM by default: useLazy mounts it on the first expand and drops it again after the collapse transition ends, so in-page find and crawlers do not reach it. Pass eager when the body must always be present.

Design tokens ​

CSS variableDefault
--origam-expansion-panel__content---displayflex
--origam-expansion-panel__content---flex1 1 auto
--origam-expansion-panel__content---max-width100%
--origam-expansion-panel__content---padding-block-start8px
--origam-expansion-panel__content---padding-block-end16px
--origam-expansion-panel__content---padding-inline-start24px
--origam-expansion-panel__content---padding-inline-end24px

The padding tokens sit on the inner __wrapper; padding / paddingInline / … apply to the region itself, so the two compose rather than replace each other.

Examples ​

Determinate loading ​

vue
<template>
    <origam-expansion-panel-content :loading="42" content="Importing…"/>
</template>

Skeleton while fetching ​

vue
<script setup lang="ts">
    const pending = ref(true)
</script>

<template>
    <origam-expansion-panel-content :loading="pending && { type: 'skeleton' }">
        {{ body }}
    </origam-expansion-panel-content>
</template>

Custom loader ​

vue
<template>
    <origam-expansion-panel-content loading>
        <template #loader>
            <origam-progress type="circular" :active="true" indeterminate/>
        </template>
    </origam-expansion-panel-content>
</template>
  • OrigamExpansionPanel — the panel that owns this content region.
  • OrigamExpansionPanelHeader — the toggling header above it.
  • OrigamExpansionPanels — the accordion container.