Motion FX JS behaviour

Timeline scene

One “play” button and the whole product story comes alive step by step: the eyebrow drops in, the title settles on a spring, items jump in with stagger, the line under the title draws itself and the action button pops in last on a springy overshoot — replay as many times as you like.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

The launch card that introduces itself

Press play and the timeline runs once, end to end: title, items, line, button — each on its own beat with a spring that overshoots and settles. The rail under the card lights each step as it lands.

Release notes · 3.0

Orbit 3.0

  • 42% faster
  • Offline sync
  • 4 new languages

The real launch would open now — this one is only the scene.

Important props

Important props
Prop Type Default What it does
steps timeline '4 · 0.05 → 1.05s' Four steps with choreographed delays: title entrance, item hops, the line draw and the button pop; the rail under the scene mirrors that same order.
ease cubic-bezier '(.34, 1.56, .64, 1)' The anime.js-style spring that overshoots and settles back — this scene’s soul.
pathLength number '100' The SVG line is normalised with pathLength=100, so drawing it is just stroke-dashoffset sliding from 100 to 0.
replay action 'reset + rerun' Replay drops the scene back to zero, waits one frame for styles to settle and plays it again from the very first step.
prefers-reduced-motion behaviour 'final' With reduced motion the scene shows its complete final state immediately.

Snippet

<div class="mfxs" x-data="timelineScene()" x-bind:data-phase="phase">
<div class="mfxs-stage">
<p class="mfxs-eyebrow">Release notes · 3.0</p>
<h3 class="mfxs-title">Orbit 3.0</h3>
<svg class="mfxs-line" viewBox="0 0 320 24"><path pathLength="100" d="M4 16 C 80 4 240 4 316 14" /></svg>
<ul class="mfxs-items">
<li>42% faster</li><li>Offline sync</li><li>4 new languages</li>
</ul>
<button class="mfxs-cta">Start Orbit 3.0</button>
</div>
<button class="mfxs-play" x-on:click="play()" x-text="phase === 'idle' ? 'Play' : 'Replay'"></button>
</div>

<style>
.mfxs-eyebrow, .mfxs-title, .mfxs-items li, .mfxs-cta { opacity: 0; translate: 0 18px; scale: .92;
    transition: all .6s cubic-bezier(.34, 1.56, .64, 1); }
.mfxs[data-phase='run'] .mfxs-eyebrow { opacity: 1; translate: none; scale: 1; transition-delay: .05s; }
.mfxs[data-phase='run'] .mfxs-title { opacity: 1; translate: none; scale: 1; transition-delay: .18s; }
.mfxs[data-phase='run'] .mfxs-items li { opacity: 1; translate: none; scale: 1; }
.mfxs[data-phase='run'] .mfxs-items li:nth-child(1) { transition-delay: .42s; }
.mfxs[data-phase='run'] .mfxs-items li:nth-child(2) { transition-delay: .54s; }
.mfxs[data-phase='run'] .mfxs-items li:nth-child(3) { transition-delay: .66s; }
.mfxs[data-phase='run'] .mfxs-cta { opacity: 1; translate: none; scale: 1; transition-delay: 1.05s; }
.mfxs-line path { fill: none; stroke: #6366f1; stroke-width: 2.5; stroke-linecap: round;
                  stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .9s ease-out .8s; }
.mfxs[data-phase='run'] .mfxs-line path { stroke-dashoffset: 0; }
</style>
// app/Pages/Launch.jsx — Inertia (React) page; renders the React
// snippet below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import LaunchScene from '@/components/LaunchScene';

export default function Launch() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <main className="nx-page">
        <LaunchScene />
      </main>
    </NabuXUIProvider>
  );
}
// LaunchScene.jsx — a staged product intro with spring easing and stagger
import { useEffect, useRef, useState } from 'react';
import '@nabuxai/ui-core/css';

const ITEMS = ['42% faster', 'Offline sync', '4 new languages'];
const SPRING = 'cubic-bezier(.34, 1.56, .64, 1)';
const STEP_AT = [180, 420, 800, 1050];   // when each rail dot lights up

export default function LaunchScene() {
  const [phase, setPhase] = useState('idle');   // idle → run → done
  const [step, setStep] = useState(0);
  const timers = useRef<number[]>([]);

  useEffect(() => () => timers.current.forEach(clearTimeout), []);  // cleanup

  const play = () => {
    timers.current.forEach(clearTimeout);
    timers.current = [];
    setStep(0);
    setPhase('idle');
    // one frame at zero so the styles settle, then run the timeline
    requestAnimationFrame(() => requestAnimationFrame(() => {
      setPhase('run');
      STEP_AT.forEach((ms, i) => {
        timers.current.push(window.setTimeout(() => setStep(i + 1), ms));
      });
      timers.current.push(window.setTimeout(() => setPhase('done'), 1900));
    }));
  };

  return (
    <>
      <style>{`
        .mfxs-stage { display: grid; gap: .9rem; justify-items: center; text-align: center;
                      padding: 2.5rem 1.5rem; border: 1px solid #d9dde4; border-radius: 1.25rem;
                      background: #fafafa; max-inline-size: 34rem; }
        .mfxs-eyebrow { margin: 0; font: 600 .72rem/1 system-ui; letter-spacing: .14em;
                        text-transform: uppercase; color: #5c6270; }
        .mfxs-title { margin: 0; font: 800 clamp(2rem, 6vw, 3rem)/1.1 system-ui; color: #16181d; }
        .mfxs-piece { opacity: 0; translate: 0 18px; scale: .92;
                      transition: all .6s ${SPRING}; }
        .mfxs-stage[data-phase='run'] .mfxs-piece, .mfxs-stage[data-phase='done'] .mfxs-piece {
          opacity: 1; translate: none; scale: 1; }
        .mfxs-stage[data-phase='run'] .mfxs-eyebrow, .mfxs-stage[data-phase='done'] .mfxs-eyebrow { transition-delay: .05s; }
        .mfxs-stage[data-phase='run'] .mfxs-title, .mfxs-stage[data-phase='done'] .mfxs-title { transition-delay: .18s; }
        .mfxs-items { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
        .mfxs-items li { padding: .45rem .9rem; border: 1px solid #d9dde4; border-radius: 999px;
                         background: #fff; font: 600 .8rem/1 system-ui; }
        .mfxs-stage[data-phase='run'] .mfxs-items li:nth-child(1), .mfxs-stage[data-phase='done'] .mfxs-items li:nth-child(1) { transition-delay: .42s; }
        .mfxs-stage[data-phase='run'] .mfxs-items li:nth-child(2), .mfxs-stage[data-phase='done'] .mfxs-items li:nth-child(2) { transition-delay: .54s; }
        .mfxs-stage[data-phase='run'] .mfxs-items li:nth-child(3), .mfxs-stage[data-phase='done'] .mfxs-items li:nth-child(3) { transition-delay: .66s; }
        .mfxs-line { inline-size: min(18rem, 70vw); }
        .mfxs-line path { fill: none; stroke: #6366f1; stroke-width: 2.5; stroke-linecap: round;
                          stroke-dasharray: 100; stroke-dashoffset: 100;
                          transition: stroke-dashoffset .9s ease-out .8s; }
        .mfxs-stage[data-phase='run'] .mfxs-line path, .mfxs-stage[data-phase='done'] .mfxs-line path { stroke-dashoffset: 0; }
        .mfxs-cta { border: 0; border-radius: 999px; padding: .85rem 1.6rem; background: #16181d; color: #fff;
                    font: 700 .9rem/1 system-ui; cursor: pointer; }
        .mfxs-stage[data-phase='run'] .mfxs-cta, .mfxs-stage[data-phase='done'] .mfxs-cta { transition-delay: 1.05s; }
        .mfxs-rail { display: flex; gap: .9rem; margin-block-start: 1rem; }
        .mfxs-dot { inline-size: .6rem; aspect-ratio: 1; border-radius: 50%; background: #d9dde4;
                    transition: background-color .2s, scale .3s ${SPRING}; }
        .mfxs-dot[data-on] { background: #6366f1; scale: 1.35; }
        .mfxs-play { margin-block-start: 1rem; border: 1px solid #6366f1; border-radius: 999px;
                     padding: .6rem 1.4rem; background: #fff; color: #6366f1; cursor: pointer; }
        @media (prefers-reduced-motion: reduce) {
          .mfxs-piece, .mfxs-line path { transition: none; opacity: 1; translate: none; scale: 1; stroke-dashoffset: 0; }
        }
      `}</style>
      <div className="mfxs-stage" data-phase={phase}>
        <p className="mfxs-piece mfxs-eyebrow">Release notes · 3.0</p>
        <h3 className="mfxs-piece mfxs-title">Orbit 3.0</h3>
        <svg className="mfxs-line" viewBox="0 0 320 24" aria-hidden="true">
          <path pathLength={100} d="M4 16 C 80 4 240 4 316 14" />
        </svg>
        <ul className="mfxs-items">
          {ITEMS.map((t) => <li className="mfxs-piece" key={t}>{t}</li>)}
        </ul>
        <button type="button" className="mfxs-piece mfxs-cta">Start Orbit 3.0</button>
        <div className="mfxs-rail" aria-hidden="true">
          {[0, 1, 2, 3].map((i) => <span className="mfxs-dot" key={i} data-on={step > i || undefined} />)}
        </div>
      </div>
      <button type="button" className="mfxs-play" onClick={play}>
        {phase === 'idle' ? 'Play' : 'Replay'}
      </button>
    </>
  );
}
<!-- LaunchScene.vue — a staged product intro with spring easing and stagger -->
<script setup lang="ts">
import { onBeforeUnmount, ref } from 'vue';
import '@nabuxai/ui-core/css';

const items = ['42% faster', 'Offline sync', '4 new languages'];
const stepAt = [180, 420, 800, 1050];   // when each rail dot lights up
const phase = ref('idle');               // idle → run → done
const step = ref(0);
let timers: number[] = [];

const play = () => {
  timers.forEach(clearTimeout);
  timers = [];
  step.value = 0;
  phase.value = 'idle'
  // one frame at zero so the styles settle, then run the timeline
  requestAnimationFrame(() => requestAnimationFrame(() => {
    phase.value = 'run'
    stepAt.forEach((ms, i) => { timers.push(window.setTimeout(() => (step.value = i + 1), ms)) })
    timers.push(window.setTimeout(() => (phase.value = 'done'), 1900))
  }))
};
onBeforeUnmount(() => timers.forEach(clearTimeout));   // cleanup
</script>

<template>
  <div class="mfxs-stage" :data-phase="phase">
    <p class="mfxs-piece mfxs-eyebrow">Release notes · 3.0</p>
    <h3 class="mfxs-piece mfxs-title">Orbit 3.0</h3>
    <svg class="mfxs-line" viewBox="0 0 320 24" aria-hidden="true">
      <path pathLength="100" d="M4 16 C 80 4 240 4 316 14" />
    </svg>
    <ul class="mfxs-items">
      <li v-for="t in items" :key="t" class="mfxs-piece">{{ t }}</li>
    </ul>
    <button type="button" class="mfxs-piece mfxs-cta">Start Orbit 3.0</button>
    <div class="mfxs-rail" aria-hidden="true">
      <span v-for="i in 4" :key="i" class="mfxs-dot" :data-on="step >= i || undefined"></span>
    </div>
  </div>
  <button type="button" class="mfxs-play" @click="play">
    {{ phase === 'idle' ? 'Play' : 'Replay' }}
  </button>
</template>

<style scoped>
.mfxs-stage { display: grid; gap: .9rem; justify-items: center; text-align: center;
              padding: 2.5rem 1.5rem; border: 1px solid #d9dde4; border-radius: 1.25rem;
              background: #fafafa; max-inline-size: 34rem; }
.mfxs-eyebrow { margin: 0; font: 600 .72rem/1 system-ui; letter-spacing: .14em;
                text-transform: uppercase; color: #5c6270; }
.mfxs-title { margin: 0; font: 800 clamp(2rem, 6vw, 3rem)/1.1 system-ui; color: #16181d; }
.mfxs-piece { opacity: 0; translate: 0 18px; scale: .92;
              transition: all .6s cubic-bezier(.34, 1.56, .64, 1); }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) :deep(.mfxs-piece) { opacity: 1; translate: none; scale: 1; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) :deep(.mfxs-eyebrow) { transition-delay: .05s; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) :deep(.mfxs-title) { transition-delay: .18s; }
.mfxs-items { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.mfxs-items :deep(li) { padding: .45rem .9rem; border: 1px solid #d9dde4; border-radius: 999px;
                        background: #fff; font: 600 .8rem/1 system-ui; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-items :deep(li:nth-child(1)) { transition-delay: .42s; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-items :deep(li:nth-child(2)) { transition-delay: .54s; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-items :deep(li:nth-child(3)) { transition-delay: .66s; }
.mfxs-line { inline-size: min(18rem, 70vw); }
.mfxs-line :deep(path) { fill: none; stroke: #6366f1; stroke-width: 2.5; stroke-linecap: round;
                         stroke-dasharray: 100; stroke-dashoffset: 100;
                         transition: stroke-dashoffset .9s ease-out .8s; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-line :deep(path) { stroke-dashoffset: 0; }
.mfxs-cta { border: 0; border-radius: 999px; padding: .85rem 1.6rem; background: #16181d; color: #fff;
            font: 700 .9rem/1 system-ui; cursor: pointer; }
.mfxs-stage:is([data-phase='run'], [data-phase='done']) :deep(.mfxs-cta) { transition-delay: 1.05s; }
.mfxs-rail { display: flex; gap: .9rem; margin-block-start: 1rem; }
.mfxs-dot { inline-size: .6rem; aspect-ratio: 1; border-radius: 50%; background: #d9dde4;
            transition: background-color .2s, scale .3s cubic-bezier(.34, 1.56, .64, 1); }
.mfxs-dot[data-on] { background: #6366f1; scale: 1.35; }
.mfxs-play { margin-block-start: 1rem; border: 1px solid #6366f1; border-radius: 999px;
             padding: .6rem 1.4rem; background: #fff; color: #6366f1; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .mfxs-piece, .mfxs-line :deep(path) { transition: none; opacity: 1; translate: none; scale: 1; stroke-dashoffset: 0; }
}
</style>
<!-- LaunchScene.svelte — a staged product intro with spring easing and stagger -->
<script lang="ts">
  import { onMount } from 'svelte';
  import '@nabuxai/ui-core/css';

  const items = ['42% faster', 'Offline sync', '4 new languages'];
  const stepAt = [180, 420, 800, 1050];   // when each rail dot lights up
  let phase = $state('idle');               // idle → run → done
  let step = $state(0);
  let timers: number[] = [];

  const play = () => {
    timers.forEach(clearTimeout);
    timers = [];
    step = 0;
    phase = 'idle';
    // one frame at zero so the styles settle, then run the timeline
    requestAnimationFrame(() => requestAnimationFrame(() => {
      phase = 'run';
      stepAt.forEach((ms, i) => { timers.push(window.setTimeout(() => (step = i + 1), ms)); });
      timers.push(window.setTimeout(() => (phase = 'done'), 1900));
    }));
  };

  onMount(() => () => timers.forEach(clearTimeout));   // cleanup
</script>

<div class="mfxs-stage" data-phase={phase}>
  <p class="mfxs-piece mfxs-eyebrow">Release notes · 3.0</p>
  <h3 class="mfxs-piece mfxs-title">Orbit 3.0</h3>
  <svg class="mfxs-line" viewBox="0 0 320 24" aria-hidden="true">
    <path pathLength={100} d="M4 16 C 80 4 240 4 316 14" />
  </svg>
  <ul class="mfxs-items">
    {#each items as t (t)}
      <li class="mfxs-piece">{t}</li>
    {/each}
  </ul>
  <button type="button" class="mfxs-piece mfxs-cta">Start Orbit 3.0</button>
  <div class="mfxs-rail" aria-hidden="true">
    {#each [1, 2, 3, 4] as i (i)}
      <span class="mfxs-dot" data-on={step >= i || undefined}></span>
    {/each}
  </div>
</div>
<button type="button" class="mfxs-play" onclick={play}>
  {phase === 'idle' ? 'Play' : 'Replay'}
</button>

<style>
  .mfxs-stage { display: grid; gap: .9rem; justify-items: center; text-align: center;
                padding: 2.5rem 1.5rem; border: 1px solid #d9dde4; border-radius: 1.25rem;
                background: #fafafa; max-inline-size: 34rem; }
  .mfxs-eyebrow { margin: 0; font: 600 .72rem/1 system-ui; letter-spacing: .14em;
                  text-transform: uppercase; color: #5c6270; }
  .mfxs-title { margin: 0; font: 800 clamp(2rem, 6vw, 3rem)/1.1 system-ui; color: #16181d; }
  .mfxs-piece { opacity: 0; translate: 0 18px; scale: .92;
                transition: all .6s cubic-bezier(.34, 1.56, .64, 1); }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-piece { opacity: 1; translate: none; scale: 1; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-eyebrow { transition-delay: .05s; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-title { transition-delay: .18s; }
  .mfxs-items { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
  .mfxs-items li { padding: .45rem .9rem; border: 1px solid #d9dde4; border-radius: 999px;
                   background: #fff; font: 600 .8rem/1 system-ui; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-items li:nth-child(1) { transition-delay: .42s; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-items li:nth-child(2) { transition-delay: .54s; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-items li:nth-child(3) { transition-delay: .66s; }
  .mfxs-line { inline-size: min(18rem, 70vw); }
  .mfxs-line path { fill: none; stroke: #6366f1; stroke-width: 2.5; stroke-linecap: round;
                    stroke-dasharray: 100; stroke-dashoffset: 100;
                    transition: stroke-dashoffset .9s ease-out .8s; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-line path { stroke-dashoffset: 0; }
  .mfxs-cta { border: 0; border-radius: 999px; padding: .85rem 1.6rem; background: #16181d; color: #fff;
              font: 700 .9rem/1 system-ui; cursor: pointer; }
  .mfxs-stage:is([data-phase='run'], [data-phase='done']) .mfxs-cta { transition-delay: 1.05s; }
  .mfxs-rail { display: flex; gap: .9rem; margin-block-start: 1rem; }
  .mfxs-dot { inline-size: .6rem; aspect-ratio: 1; border-radius: 50%; background: #d9dde4;
              transition: background-color .2s, scale .3s cubic-bezier(.34, 1.56, .64, 1); }
  .mfxs-dot[data-on] { background: #6366f1; scale: 1.35; }
  .mfxs-play { margin-block-start: 1rem; border: 1px solid #6366f1; border-radius: 999px;
               padding: .6rem 1.4rem; background: #fff; color: #6366f1; cursor: pointer; }
  @media (prefers-reduced-motion: reduce) {
    .mfxs-piece, .mfxs-line path { transition: none; opacity: 1; translate: none; scale: 1; stroke-dashoffset: 0; }
  }
</style>