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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #default
- A single child element to be transitioned. The JS hooks read its offsetHeight to animate height from 0 to its natural size.
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>
- Utility to forward a filtered subset of props.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
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.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Toggle content vertically
Simple accordion
Respect prefers-reduced-motion
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
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.