Fade

Utilities & Providers
stable

Opacity-only enter/leave CSS transition. A thin wrapper around the generic Transition that sets name="origam-transition--fade".

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamFadeSchematic showing the fade transition: an entering element at full opacity and a leaving element at opacity 0. enter-active opacity: 0 → 1 leave-active opacity: 1 → 0 1 2 →
Anatomy of <origam-fade> — wraps a single child. During the transition, the entering element ① fades from opacity: 0 to 1 while the leaving element ② fades from 1 to 0 over 300 ms.
1.origam-transition--fade-enter-active
Applied to the entering element. Sets transition-property: opacity, duration: 0.3s, easing: cubic-bezier(0.4, 0, 0.2, 1).
2.origam-transition--fade-leave-active
Applied to the leaving element. Same duration and easing. Opacity animates from 1 to 0 via .origam-transition--fade-leave-to.

API

Props

All props accepted by this component, with their type, default value and description.

disabled
boolean
false
Disables all animation — content appears/disappears instantly. Automatically true when prefers-reduced-motion: reduce is detected.
name
string
'origam-transition--fade'
Vue transition name class prefix. Pre-set to "origam-transition--fade". Override to use a custom CSS keyframe set.
group
boolean
false
When true, renders a <transition-group> instead of <transition>. Enables list-move animation.
Vue transition mode: "in-out" (new enters then old leaves) or "out-in" (old leaves then new enters).
hideOnLeave
boolean
false
Sets the leaving element to visibility: hidden immediately so it does not participate in layout during the leave animation.
leaveAbsolute
boolean
false
Positions the leaving element absolutely during the leave phase to prevent layout jank in group transitions.
origin
string
CSS transform-origin applied to the element during the transition.

API

Slots

Content slots exposed by this component.

#default
A single child element (or multiple when group=true) that will be faded in/out.

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 element.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Fade enter/leave duration (300 ms). Hardcoded in the SCSS block as 0.3s; override via the token rebuild.
Easing function for both enter and leave phases: cubic-bezier(0.4, 0, 0.2, 1).

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

Notes

  • useCssTransition automatically sets disabled=true when prefers-reduced-motion: reduce is detected. Content appears/disappears instantly with no opacity animation.
  • The transition wrapper adds no elements to the DOM — it is transparent to the accessibility tree. 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.

Basic fade

vue

Out-in mode (swap)

vue