ExpandY

Utilities & Providers
stable

JS-driven vertical height expand/collapse transition. Animates the element height from 0 to its natural offsetHeight (enter) and back to 0 (leave). Duration 0.5s with cubic-bezier(0.4, 0, 0.2, 1). Commonly used for accordion and collapsible content.

Structure

Anatomie

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

Anatomy of OrigamExpandYSchematic showing height expansion from 0 to natural size on enter, and collapse on leave. enter-active height: 0 → offsetHeight → leave-active height: offsetHeight → 0 1 2
Anatomy of <origam-expand-y> — wraps a single element. JS hooks read offsetHeight to animate height from 0 → natural size on enter ①, and back to 0 on leave ②. overflow: hidden is set during the transition. ExpandY is the backbone of <origam-expansion-panel>.
1.origam-transition--expand-y-enter-active
Enter phase. CSS class drives transition-duration (0.5s), timing (cubic-bezier(0.4,0,0.2,1)) and transition-property (height). The JS beforeEnter hook stashes the initial height; enter sets height to 0 then requestAnimationFrame restores offsetHeight.
2.origam-transition--expand-y-leave-active
Leave phase. CSS class drives transition-duration (0.5s) and property (height). The JS leave hook stashes the current height and animates to 0. afterLeave restores the initial style.

API

Props

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

disabled
boolean
false
When true, the Vue transition uses :css="false" — JS hooks still run but no CSS classes are applied. Content appears/disappears instantly.
name
string
'origam-transition--expand-y'
Vue transition name prefix. Drives the CSS class applied on enter/leave. Overridable to use custom CSS keyframes.
group
boolean
mode
'in-out'
Vue transition mode. Defaults to 'in-out': the entering element expands first, then the leaving element collapses.
hideOnLeave
boolean
leaveAbsolute
boolean

API

Slots

Emplacements de contenu exposés par ce composant.

#default
A single child element to be transitioned. The JS hooks read its offsetHeight to animate height from 0 to its natural size.

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>
Utility to forward a filtered subset of props.

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.

Duration of the enter (expand) animation.
Easing function for the enter animation.
CSS property animated on enter.
Duration of the leave (collapse) animation.
Easing function for the leave animation.
CSS property animated on leave.
Duration of the move animation in group transitions.
CSS property animated during group moves.

Inclusion

Accessibilité

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

Notes

  • Set disabled=true to suppress all animations for users with prefers-reduced-motion: reduce. OrigamExpansionPanel passes this automatically when the media query matches.
  • ExpandY is transparent to the accessibility tree — it adds no ARIA roles or attributes. Only the slotted content is visible to screen readers.
  • During the transition, overflow: hidden is set on the element to prevent content from showing outside the animated bounds. The original overflow is restored in afterEnter / afterLeave.

Interactif

Playground

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

Rendu de l’aperçu en cours…

Usage

Exemples

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

Toggle content vertically

vue

Simple accordion

vue

Respect prefers-reduced-motion

vue

Écosystème

Famille

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