Transition
CSS-driven Vue transition wrappers. The family includes Fade, SlideX, SlideY, ExpandX, ExpandY, ScaleRotate and a generic Transition component. All are prefers-reduced-motion aware.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-transition> — wraps a single child. During a transition, the entering element ① is animated in while the leaving element ② animates out (sequence depends on mode).- 1[enter-active]
- The entering element receives the transition CSS class (e.g. origam-transition--fade-enter-active).
- 2[leave-active]
- The leaving element receives the leave-active class and exits. In out-in mode this completes before the enter starts.
API
Props
All props accepted by this component, with their type, default value and description.
- disabledbooleanfalse
- Disables all animation — content appears/disappears instantly. Automatically true when prefers-reduced-motion: reduce is detected.
- mode
- Vue transition mode: "in-out" (new enters then old leaves) or "out-in" (old leaves then new enters).
- transitionboolean | string | TTransitionProps
- namestring'origam-transition--fade'
- Vue transition name class prefix. Each sub-component sets this to its own CSS class (e.g. origam-transition--slide-x). Override to use custom CSS keyframes.
- groupbooleanfalse
- When true, renders a <transition-group> instead of <transition>. Enables list-move animation.
- hideOnLeavebooleanfalse
- Sets the leaving element to visibility: hidden immediately so it does not participate in layout during the leave animation.
- leaveAbsolutebooleanfalse
- Positions the leaving element absolutely during the leave phase to prevent layout jank in group transitions.
- originstring
- CSS transform-origin applied to the element during the transition (used by scale-based transitions).
API
Slots
Content slots exposed by this component.
- #default
- A single child element (or multiple when group=true) that will be transitioned.
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 to the underlying transition.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Default transition duration (300 ms).
- Default easing function (cubic-bezier).
- Horizontal translate distance for slide-x transition.
- Vertical translate distance for slide-y transition.
- Initial scale value for scale-based transitions.
- Duration for expand-x/expand-y transitions (400 ms — slightly slower for layout shifts).
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Notes
- All Origam transition components detect prefers-reduced-motion: reduce and disable the animation (disabled=true) automatically. Content still appears/disappears instantly.
- Transition wrappers are transparent to the accessibility tree — they add no ARIA roles or attributes. Only the slotted content is announced by screen readers.
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.
Fade
SlideX and SlideY
Expand (accordion)
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
Fade
Opacity-only enter/leave transition (origam-transition--fade).
SlideX
Horizontal slide + fade transition (origam-transition--slide-x).
SlideY
Vertical slide + fade transition (origam-transition--slide-y).
ExpandX
Horizontal width expand/collapse transition.
ExpandY
Vertical height expand/collapse transition.
ScaleRotate
Scale + rotate + fade combined transition (origam-transition--scale-rotate).