useTransition
Family of three composables (useTransition, useCssTransition, useWindowTransition) that resolve a transition name from ITransitionProps and wire optional lifecycle hooks. useCssTransition handles leaveAbsolute / hideOnLeave helpers. useWindowTransition coordinates height animations for window-based transitions in stepper or tab containers.
API
Signature
Signature TypeScript complète extraite du fichier du composable.
useWindowTransition requires an ORIGAM_WINDOW_KEY injection — it is only usable inside OrigamWindow subtrees (e.g. OrigamStepper, OrigamTabs). For standalone transitions use useCssTransition or the OrigamTransition component.
Interfaces consommées
API
Paramètres
Paramètres d'entrée acceptés par ce composable.
- propsrequisITransitionProps
- Reads `name` (CSS transition class prefix), `disabled` (bypass the transition), `group` (use TransitionGroup), `mode` (in-out / out-in), `origin` (transform-origin set on beforeEnter), `leaveAbsolute` (position the leaving element absolutely), `hideOnLeave` (display:none on leave).
API
Valeurs de retour
Propriétés et méthodes exposées par l'objet retourné par le composable.
- name
- The resolved transition name. Empty string when disabled (tells Vue not to apply CSS classes).
- isDisabled
- True when `props.disabled` is set. When disabled, `css: false` is passed to the Transition component and lifecycle hooks handle the enter/leave styles.
- tag
- `TransitionGroup` when `props.group` is true, `Transition` otherwise. Bind to `<component :is="tag">` in the consumer template.
- transitionProps
- Computed props bag to spread on the Transition / TransitionGroup root. Includes `css`, `mode`, and lifecycle hooks (onBeforeEnter, onLeave, onAfterLeave) when needed.
Usage
Exemples
Extraits de code prêts à coller.
Fade transition wrapper
Using OrigamTransition (recommended)