skip the tree
system / motion / cursor11 rebuilds

Cursor

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

the category

motion/_rebuilds
rebuilds
11
from motion+
11
easing
steps() only

motion / cursor / bobble hover

after a motion+ example
move over a tile
margin_rebuilds/​cursor/​bobble-hover.tsx
Motion
pointer position, springs
here
a cut a tile
under it
the tile fills bone
round it
4 px away, in one step
original
Bobble hover

The tile under the pointer cuts to a bone fill, and the tiles round it cut 4 px away from it; both cut back when the pointer leaves. The arrow keys move a pointer one cell.

motion / cursor / cursor: floating target

after a motion+ example
move onto the word
margin_rebuilds/​cursor/​cursor-floating-target.tsx
Motion
a floating cursor, springs
here
a cut to the frame
in the stage
a dot, a cell a step
on the word
its frame, the Dither, a label

The dot jumps from cell to cell. Over the word it cuts to a frame round the word, with the Dither inside and a label above; off the word it cuts back to the dot.

motion / cursor / magnetic filings

after a motion+ example
move in the grid
margin_rebuilds/​cursor/​magnetic-filings.tsx
Motion
pointer position, a rotation
here
a cut a cell
lines
80, each on one of four axes
at rest
all point at the middle

Each line cuts to the nearest of four axes toward the pointer's cell, a 45 degree step at a time. With no pointer the lines point at the middle.

motion / cursor / cursor trail

after a motion+ example
move the pointer across the stage
margin_rebuilds/​cursor/​cursor-trail.tsx
Motion
AnimatePresence, a fade
here
every(), 120 ms
a stamp
every 16 px, the last 8
wear
greys, then removed
original
Cursor trail

A square is stamped every 16 px of the pointer's way, and the last eight stay. They wear in solid greys and, when the pointer rests, leave one by one every 120 ms. Under reduced motion there are no stamps.

motion / cursor / cursor trail velocity

after a motion+ example
move slowly, then quickly
margin_rebuilds/​cursor/​cursor-trail-velocity.tsx
Motion
pointer velocity, a scale
here
every(), 120 ms
a stamp
16 to 48 px wide
size
by cells a move

The same trail as Cursor trail, but a stamp is as wide as the pointer was quick: one cell a move is 16 px, and four more cells widen it by 8 px each, up to 48 px.

motion / cursor / cursor: magnetic target

after a motion+ example
bring the pointer near a button
margin_rebuilds/​cursor/​cursor-magnetic.tsx
Motion
a cursor pulled to a target
here
a cut to the frame
reach
24 px from a button
focus
the bone ring

The dot jumps from cell to cell. Within 24 px of a button it cuts to a frame round the button, and cuts back when the pointer is further away. A press acts as on any button; Tab gives the ring.

motion / cursor / cursor: image hover

after a motion+ example
move down the list
margin_rebuilds/​cursor/​cursor-hover-follow.tsx
Motion
useSpring, useVelocity
here
a tile a cell
over a row
the row fills bone
the tile
beside the pointer

Over a row a tile shows beside the pointer and jumps with it from cell to cell; there is no lag and no tilt. At the right edge it moves to the left of the pointer. Focus on a row shows a small tile at its end.

motion / cursor / line graph

after a motion+ example
move along the line, or Tab to a point
margin_rebuilds/​cursor/​line-graph.tsx
Motion
AnimateNumber, a cursor
here
a cut a point
points
7, each a button
reading
the change, in a label
original
Line graph

The point nearest the pointer, within 40 px, fills bone and shows its value and its change from the point before; a dashed rule drops from it. Focus on a point shows the same. The number does not roll.

motion / cursor / cursor: custom content

after a motion+ example
move over a photo, then press it
margin_rebuilds/​cursor/​cursor-custom-content.tsx
Motion
whileHover, a cursor
here
a cut to a label
in the stage
a dot, a cell a step
on a photo
the label view gallery

The dot jumps from cell to cell. Over a photo it cuts to a label that stays at the pointer's cell, and cuts back to the dot when the pointer leaves the photo. Focus on a photo shows the label on it.

motion / cursor / cursor: multi-follow

after a motion+ example
move the pointer, then stop
margin_rebuilds/​cursor/​cursor-multifollow.tsx
Motion
many cursors, springs
here
every(), 40 ms
followers
3 frames, 16 to 32 px
lag
one step each

The dot is the pointer's cell. One clock moves each follower to the cell of the one before it every 40 ms, so they trail the dot and meet it when the pointer rests. Under reduced motion they sit on the dot.

motion / cursor / cursor: adaptive caret size

after a motion+ example
move over each line
margin_rebuilds/​cursor/​cursor.tsx
Motion
an adaptive caret
here
a cut to a caret
in the stage
a dot, a cell a step
over text
a caret as tall as the line

The dot jumps from cell to cell. Over a line of text it cuts to a 2 px caret as tall as that line, at the pointer's cell, in each of three sizes; off the text it cuts back to the dot.