Skip to content

OrigamTranslatePicker ​

<OrigamTranslatePicker> is the wheel-picker style transition: the new item slides in from the right (translate(100%, 0)) and the previous one leaves to the left (translate(-100%, 0)). The two children overlap during transition because the leaving slot is position: absolute.

Use for date / time pickers, swap-style detail panels, and any left-to-right "advance" gesture.

Basic usage ​

vue
<template>
    <OrigamTranslatePicker>
        <Page :key="currentPage" />
    </OrigamTranslatePicker>
</template>

:key must change between renders — that's what triggers the enter/leave cycle.

CSS classes emitted ​

origam-transition--translate-picker-enter-from    { transform: translate(100%, 0); opacity: 0; }
origam-transition--translate-picker-leave-to      { transform: translate(-100%, 0); opacity: 0; }
origam-transition--translate-picker-leave-active,
origam-transition--translate-picker-leave-from,
origam-transition--translate-picker-leave-to      { position: absolute !important; }
origam-transition--translate-picker-enter-active,
origam-transition--translate-picker-leave-active  { transition: 0.3s standard; }

CSS variables consumed ​

Declared in assets/css/tokens/light.css. Before #538 these were CSS literals inside the component's own <style> block — no theme could reach them.

VariableDefault
--origam-transition--translate-picker-enter-active---transition-duration0.3s
--origam-transition--translate-picker-enter-active---transition-timing-functionvar(--origam-motion__easing---standard)
--origam-transition--translate-picker-leave-active---transition-duration0.3s
--origam-transition--translate-picker-leave-active---transition-timing-functionvar(--origam-motion__easing---standard)
--origam-transition--translate-picker-move---transition-duration0.3s
--origam-transition--translate-picker-move---transition-timing-functionvar(--origam-motion__easing---standard)

Override at the document root or on a specific instance:

css
.my-panel {
    --origam-transition--translate-picker-enter-active---transition-duration: 0.15s;
}

Props ​

<OrigamTranslatePicker> declares the whole shared ITransitionProps surface and wires it through useCssTransition.

PropTypeDefaultDescription
namestring'origam-transition--translate-picker'Transition class prefix. Change it only to swap in your own keyframes.
disabledbooleanundefinedSets css: false on the underlying <transition>, so the enter / leave classes are never applied and the content swaps instantly.
groupbooleanundefinedRender a <transition-group> instead of a <transition>. The …-move rule in the stylesheet only applies on this path.
originstringundefinedWritten to transform-origin on the element in the beforeEnter hook. See the note below.
hideOnLeavebooleanundefineddisplay: none !important on the leaving element for the whole leave phase. Note this fights the built-in slide-out — the leaving child disappears instead of sliding left.
leaveAbsolutebooleanundefinedFreezes the leaving element's box at its measured top / left / width / height. Largely redundant here: the stylesheet already forces position: absolute !important on the leave classes.
modeTTransitionModeundefined⛔ Declared but inert. See the note below.

Emits ​

None. ITransitionEmits is empty for every member of the family.

Slots ​

SlotScopeDescription
default—The transitioned content. Its :key must change for the enter / leave cycle to run.

Notes ​

  • The parent container should be position: relative so the absolutely positioned leaving child stays put.
  • For the opposite direction (right-to-left), use OrigamReverseTranslatePicker.
  • origin sets the property but this transition has nothing to anchor on. transform-origin changes where a scale or rotate pivots; the enter / leave keyframes here only translate, which is origin-independent.
  • ⛔ mode has no effect on this component, measured on the rendered tree rather than inferred. useCssTransition only forwards it on the group path, and Vue's TransitionGroup does not declare mode ('mode' in TransitionGroup.props === false) — it lands as an inert DOM attribute. On the default path the wrapper absorbs mode as a declared prop, so it never falls through to <Transition>, which does declare it. Use <OrigamTransition> or a plain <transition mode="out-in"> when you need enter / leave ordering.
  • prefers-reduced-motion: reduce collapses enter-active, leave-active and move to 0.01ms.

Accessibility ​

Reduced motion is handled by the component itself — you do NOT need to pass disabled from a matchMedia listener. Every member of the family emits a @media (prefers-reduced-motion: reduce) block (shared ds-reduced-motion mixin, issue #494) that collapses the duration to 0.01ms.

That override wins over the CSS variables above, deliberately: it zeroes the PROPERTY, not the variable, so a theme or a per-instance duration cannot resurrect the motion for a user who asked for none. Verified in Chromium — setting a 9 s duration through the token under prefers-reduced-motion: reduce still measures 0.01ms.

disabled remains available for the unrelated case of skipping the transition on purpose.