skip the tree
system / motion / buttons8 rebuilds

Buttons

The Buttons examples of the Motion library, rebuilt in Composite: the same trigger, in steps, with the system's own parts.

the category

motion/_rebuilds
rebuilds
8
from motion+
6
easing
steps() only

motion / buttons / long press

after a motion.dev example
hold it for a second
margin_rebuilds/​buttons/​press-hold.tsx
Motion
whileTap, a timer
here
play(), 10 frames
a frame
100 ms, the frame grows
done
a cut, then a Glitch
original
Long press

A frame draws round the button in ten steps while it is held; closed, the button cuts to unlocked and glitches. A release before then cuts the frame back to nothing.

motion / buttons / press and hold to repeat

after a motion.dev example
hold − or +
margin_rebuilds/​buttons/​press-repeat.tsx
Motion
whileTap, useAnimate
here
wait(), then every()
first
at once
then
every 120 ms, after 400 ms

A held press acts at once, then once every 120 ms after a 400 ms wait: each a step of the count.

motion / buttons / copy button

after a motion+ example
copy the command
margin_rebuilds/​buttons/​copy-button.tsx
Motion
AnimatePresence, layout
here
a cut, then a Glitch
copied
1.5 s
a failed copy
a Fault
original
Copy Button

The label cuts to copied, with a check, for 1.5 s; a copy that fails is a Fault.

motion / buttons / dots morph button

after a motion+ example
hover it
margin_rebuilds/​buttons/​dots-morph-button.tsx
Motion
whileHover, whileTap
here
the State set
at rest
four squares
hover
a cross, in one cut

Four squares cut to a cross on hover or keyboard focus; nothing moves between the two shapes.

motion / buttons / confetti

after a motion+ example
click it
margin_rebuilds/​buttons/​confetti.tsx
Motion
animate, per piece
here
play(), 6 frames
a frame
80 ms, 2 steps
pieces
16 block glyphs, falling
original
Confetti

Block glyphs fall from the button in six frames, in two inks, and wear down to nothing.

motion / buttons / material design: ripple

after a motion+ example
press it anywhere
margin_rebuilds/​buttons/​material-design-ripple.tsx
Motion
AnimatePresence, a scale
here
play(), 5 rings
a frame
80 ms, 2 steps
from
the press point

Square rings grow from the press point, one ring a step, then are gone.

motion / buttons / hold to confirm

after a motion+ example
hold it until the frame closes
margin_rebuilds/​buttons/​hold-to-confirm.tsx
Motion
useMotionValue
here
play(), 12 frames
a frame
100 ms, the frame grows
let go
back to empty

A frame draws round the button in twelve steps while it is held; closed, the button cuts to confirmed. A release before then cuts the frame back to nothing.

motion / buttons / multi state badge

after a motion+ example
send it, or make it fail
margin_rebuilds/​buttons/​multi-state-badge.tsx
Motion
AnimatePresence
here
a cut a state
sending
the scan mark
failed
a Fault

The badge cuts from state to state: ready, sending with the scan mark, then sent, or failed as a Fault.