Motion and reduced motion
Choose easing curves, durations, and springs by how often an
action occurs, and support reduced motion.
This page explains how to choose easing curves, durations, and springs in QML, how Ljós handles reduced motion automatically, how a component gates its own motion, and what the
motion-* rules check.Motion in an interface exists to confirm that input landed, show where an element came from or went, or connect a state before and after a change. Motion without a clear purpose is only a delay.
Linear motion starts and stops abruptly, so every spatial or opacity transition should set
easing.type:Ease-out (
Easing.OutCubic or Easing.OutQuint): Fast start and gentle stop. Use ease-out for anything that enters the screen or responds to user input (opening a menu or dialog, pressing a button) so the interface reacts on the very first frame.Ease-in-out (
Easing.InOutCubic): Use for an item moving from one position on screen to another.Ease-in (
Easing.InCubic): Slow start. Use ease-in only for elements leaving the screen. Using ease-in on an entrance makes the interface feel sluggish because the first frames barely move (motion-ease-in-enter).Linear: Reserve linear easing for constant loops such as spinners or time-tracking progress bars.
Custom cubic Bézier (
Easing.BezierSpline): Set easing.bezierCurve: [x1, y1, x2, y2, 1, 1] for named curves such as a strong ease-out ([0.23, 1, 0.32, 1]), Material emphasized decelerate ([0.05, 0.7, 0.1, 1]), Material emphasized accelerate ([0.3, 0, 0.8, 0.15]), or a drawer curve ([0.32, 0.72, 0, 1]).How often a user sees an animation matters more than how large it is:
Never use a visible duration below
limits::motion::MIN_VISIBLE_MS (50 ms), which reads as a flicker; use 0 instead.Exits are shorter than entrances (
motion-exit-slower): Make exit transitions about 60 to 70 % of the entrance duration, because the user has already decided to move on.Scale from
0.95, never 0 (motion-scale-from-zero): Start popup entrances at scale 0.95 (limits::motion::ENTER_SCALE_RECOMMENDED) combined with an opacity fade so the content is legible throughout the transition.Grow from the trigger (
motion-origin): Set transformOrigin on a Menu, Popup, or ToolTip toward the button that opened it (for example, Popup.TopLeft). Modal dialogs stay centred.Use interruptible animations:
Behavior and SpringAnimation retarget smoothly when the user acts mid-animation. Keep springs well damped (damping ratio at least limits::motion::SPRING_MIN_DAMPING_RATIO, no bounce on controls or panels), and do not use springs for colour or opacity.When the user requests reduced motion (
Qt.styleHints.accessibility.motionPreference === Qt.MotionPreference.ReducedMotion), replace spatial movement, scaling, parallax, and springs with a short opacity cross-fade so state changes remain clear without triggering vestibular discomfort (WCAG 2.2 SC 2.3.3).On Ljós, the runtime enforces reduced motion across every animation even if a component does not check the setting itself:
1.
Spatial properties snap at once: Animations of position (
x, y), size, scale, rotation, scroll position, or drawer position jump immediately to their target value.2.
Fades are preserved and capped: Opacity and colour animations keep their easing curve and are capped at
limits::motion::REDUCED_FADE_MAX_MS (150 ms). Shorter fades keep their own duration.3.
Moving popups and pages cross-fade instead: If a
Popup, Menu, Dialog, Drawer, or StackView page transition would move the item without fading it, Ljós substitutes an opacity fade at its final position and fires opened, closed, and page lifecycle signals in the normal order when the fade finishes.4.
Essential endless spinners keep running: A
BusyIndicator or indeterminate ProgressBar continues to turn. Endless decorative animations should still be gated by the application (motion-reduced-ignored).5.
Mid-flight changes never jump backwards: Toggling reduced motion while an animation is running continues smoothly from its current state.
A component can also gate its own motion. Its file then says what it does under reduced motion, to a reader and to any runtime that leaves the transition logic to the application. Include an explicit opacity fade and gate spatial motion and decorative loops on
motionPreference. Ljós's own API has no home for Qt.MotionPreference yet, so this example is written in Qt's:Animating
height triggers motion-layout-property and relayouts the window on every frame. Instead, clip the container and animate y on the inner item:




