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
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #default
- A single child element (or multiple when group=true) that will be transitioned.
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 to the underlying transition.
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.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
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.
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.
Fade
SlideX and SlideY
Expand (accordion)
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
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).