ExpandY
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.
<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.
- disabledbooleanfalse
- When true, the Vue transition uses :css="false" — JS hooks still run but no CSS classes are applied. Content appears/disappears instantly.
- namestring'origam-transition--expand-y'
- Vue transition name prefix. Drives the CSS class applied on enter/leave. Overridable to use custom CSS keyframes.
- groupboolean
- Vue transition mode. Defaults to 'in-out': the entering element expands first, then the leaving element collapses.
- hideOnLeaveboolean
- leaveAbsoluteboolean
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
Simple accordion
Respect prefers-reduced-motion
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
Transition
Generic CSS-driven Vue transition wrapper.
ExpandX
Horizontal width expand/collapse transition (counterpart to ExpandY).
Fade
Opacity-only enter/leave transition.
SlideX
Horizontal slide + fade transition.
SlideY
Vertical slide + fade transition.
ScaleRotate
Scale + rotate + fade combined transition.