SlideX
CSS-driven Vue transition that slides a child element horizontally (translateX −15px → identity) combined with an opacity fade. Sub-component of the Transition family.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-slide-x> — enter ① slides from translateX(−15px) + opacity:0 to identity. Leave ② reverses the same transform + fades out. Duration: 0.3 s; move: 0.5 s.- 1.origam-transition--slide-x-enter-active
- Enter phase. Child animates from translateX(−15px) + opacity:0 to identity. Duration: 0.3 s, easing: cubic-bezier(0.4,0,0.2,1).
- 2.origam-transition--slide-x-leave-active
- Leave phase. Child slides back to translateX(−15px) + opacity:0 over 0.3 s.
API
Props
All props accepted by this component, with their type, default value and description.
- mode
- Vue transition mode: "in-out" or "out-in".
- disabledbooleanfalse
- Disables the animation. Content appears/disappears instantly.
- namestring'origam-transition--slide-x'
- Vue transition name class prefix. Defaults to origam-transition--slide-x.
- groupbooleanfalse
- When true, renders a <transition-group> to enable list-move animation.
- hideOnLeavebooleanfalse
- Sets the leaving element to visibility: hidden immediately.
- leaveAbsolutebooleanfalse
- Positions the leaving element absolutely during leave to prevent layout jank.
- originstring
- CSS transform-origin applied during the transition.
API
Slots
Content slots exposed by this component.
- #default
- A single child element (or multiple when group=true) that receives the horizontal slide transition.
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>
- Forwards 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.
- Horizontal translate distance token. The component hardcodes −15px in its CSS class; this token is the declared reference value.
- Default transition duration (0.3 s hardcoded in CSS class).
- Easing function for slide-x (decelerate: cubic-bezier(0.4,0,0.2,1)).
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Notes
- Animation is disabled automatically when prefers-reduced-motion: reduce is detected (disabled=true via useCssTransition).
- The wrapper is transparent to the accessibility tree. Only the slotted child 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 horizontal slide
out-in mode (tab content)
List animation (group)
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
Transition
CSS-driven Vue transition wrappers. Fade, SlideX, SlideY, ExpandX, ExpandY, ScaleRotate.
Fade
Opacity-only enter/leave transition.
SlideY
Vertical slide + fade transition.
ExpandX
Horizontal width expand/collapse transition.
ExpandY
Vertical height expand/collapse transition.
ScaleRotate
Scale + rotate + fade combined transition.