Playground

Change the timing of useMorph and see it on the tiles of this page and on the phone demo.

The controls change the options of two useMorph hooks on this page: the one behind the tiles, which opens a panel over the page, and the one inside the phone demo. Change a value, then click a tile or a delivery. The code under the controls is the call that gives you the same result.

Duration
Easing
Motion
const morph = useMorph(); // the defaults

Tiles on this page

These open into the page's own panel, with the options above.

Duration

How long each way

Open and close are separate. Closing is usually shorter.

Easing

How the speed changes

The surface curve drives the clip, the flights and the background.

Stagger

Blocks one after another

Each block below the header starts a little after the one above it.

The phone demo

Same options, a second hook inside the frame.

Relay

Deliveries

This week · 10 deliveries

All 10ScheduledIn transitDelivered
  • RotterdamNLAntwerpBE
    Northwind Logistics
    #2041 · Sep 27
    Pickup at 08:30
    Scheduled
  • LyonFRMilanIT
    Bellweather Foods
    #2042 · Sep 27
    2 of 3 stops done
    In transit
  • HamburgDECopenhagenDK
    Fjord Freight
    #2043 · Sep 26
    Signed by M. Holm
    Delivered
  • Saint-Jean-de-LuzFRFrankfurt am MainDE
    Compagnie Générale de Transports et d'Entreposage du Sud-Ouest
    #2044 · Sep 26
    Waiting at the border
    Delayed
  • PortoPTMadridES
    Atlântico Cargo
    #2045 · Sep 25
    ETA 16:45
    In transit
  • ViennaATPragueCZ
    Danube Parcel Co.
    #2046 · Sep 25
    Pickup at 14:00
    Scheduled
  • OsloNOGothenburgSE
    Skagerrak Shipping
    #2047 · Sep 24
    Signed by A. Berg
    Delivered
  • ZurichCHMunichDE
    Alpine Express
    #2048 · Sep 24
    1 of 2 stops done
    In transit
  • BarcelonaESMarseilleFR
    Costa Brava Transports
    #2049 · Sep 23
    Pickup at 07:45
    Scheduled
  • DublinIEManchesterGB
    Liffey Line
    #2050 · Sep 23
    Signed by R. Doyle
    Delivered
state: closed

What the options do

OptionDefaultEffect
duration{ open: 400, close: 300 }Length of each direction in ms. Every part of the transition is a fraction of it.
easing.surfacecubic-bezier(0.32, 0.72, 0, 1)The clip, the shared flights and the background.
easing.contentcubic-bezier(0.23, 1, 0.32, 1)The staggered blocks and the action bar.
stagger45Delay between blocks marked data-morph-stagger, in ms.
backgroundScale0.96How far the page behind recedes. false keeps it still.
reducedMotion"system"true forces the opacity-only version.
timeScale1Multiplies every duration. For reviewing motion, not for production.

Slow motion is the quickest way to judge a curve: at 4× you can see where the motion spends its time. Keep production durations short; the defaults are already on the slow side for a detail view.

Made by Lucas Piera