Skip to content

Fluid Hover

Hover that glides from item to item under your cursor instead of blinking between them.

Show the math

By default the item under the pointer lights, and empty space puts the highlight out. Pass nearest for 1 rule with no dead zones: the nearest dot wins. Flip the switch and that is the whole algorithm.

3 axes

Menus, tabs, and card grids all feel the same under the cursor. With nearest, pass y, x, or xy to say how near is measured: down the list, across the strip, or to the closest card.

axis="x"strips: tabs

axis="y"lists: menus, tables, radios

axis="xy"grids: card groups

Inbox

Everything new lands here.

Drafts

Unsent, saved as you type.

Sent

Delivered and archived.

Trash

Emptied after 30 days.

When to split a list

Split at the divider. Rows that are alternatives to each other share 1 list, children included, and the highlight never crosses into the next one.

What it costs

One moving highlight and one pick per animation frame. Hover and scroll through the 200 rows to see the measured cost.

0movescounts as you hover
0.000 mspick per move0.00% of a 16.7 ms frame
0.0 mslongest frameincludes layout and paint
0layout writeschanges to highlight bounds after first placement

Reduced motion

The highlight respects the OS setting on its own. Turn on reduced motion and the travel drops out: the highlight still fades in on the row under the pointer, it just stops sliding between rows. The native HoverHighlight observes the preference itself, so a copied component behaves the same in your app.

Reference

Attach ObserveFluidHover to a root with one highlight layer and indexed items. Use nearest with x, y, or xy to choose the axis. Focus, roles, and focus rings stay with your rows.

The highlight moves on a transform. Width and height only animate between items of different sizes.

Options

Returns

FluidHoverHighlight

Effect UI port notes

The cursors demonstrate the same nearest-row behavior as a mouse. The 200-row list measures the actual pick and changes to the highlight’s layout.