How it works
Each row is a full-width button or link with the title on the left and the details on the right, between hairlines. When the pointer enters, the list is measured once and a frame loop eases the picture toward a spot 24px beside the pointer and clear of the row's title (on the pointer's left near the right edge), sliding from below the pointer at the top of the list to above it at the bottom, so it never leaves the list. Its lean comes from its own sideways speed and eases back to level when it stops. A band slides behind the lit row and the other rows fade to 42%. Every row change adds a new layer that uncovers from the middle out, from blurred, a little larger and more saturated to sharp, over the previous picture, which is then removed. Leaving the list shrinks the picture to 55% with a blur and fades it. Touch, pen and the keyboard have no pointer to follow, so they pin the picture at the right end of the list, centred on the row and clear of its title.
Use it for
- Indexes where each entry has a picture but the list should stay text: projects in a portfolio, journal entries, case studies, collections, recipes.
- Editorial pages that want a calm list at rest and a lively one under the pointer.
Look elsewhere when
- When the picture is what people choose by: show a grid of cards instead.
- Long lists people scan for a word: the moving picture gets in the way; use a plain list with search.
Usage
import { HoverPreviewList } from './HoverPreviewList.jsx'
const notes = [
{ id: 'ferry', title: 'Morning ferry', meta: 'Coast', year: 2026, preview: <img src="/notes/ferry.jpg" alt="" /> },
{ id: 'market', title: 'Night market', meta: 'Old town', year: 2025, preview: <img src="/notes/market.jpg" alt="" /> },
{ id: 'terraces', title: 'Rice terraces', meta: 'Valley', year: 2023 },
]
export function FieldNotes({ onOpen }) {
return <HoverPreviewList label="Field notes" items={notes} numbered onSelect={(item) => onOpen(item.id)} />
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
items | { id?, title, meta?, year?, href?, preview?, tone? }[] | [] | The rows. preview is the picture (any element, such as an <img> or an <svg>, or a function of the item and its index); without one the row gets a soft field in one of the chart colours (tone picks it) with its initial. With href the row is a link, otherwise a button. |
onSelect | (item, index, event) => void | — | Called when a row is opened: a click, Enter, or the second tap on touch. |
label | string | — | Accessible name for the list. |
follow | boolean | true | With a mouse the picture follows the pointer. false pins it beside the hovered row instead, the way touch and the keyboard always show it. |
numbered | boolean | false | Shows a two-digit number before each title; the lit row's number takes the accent colour. |
restingIndex | number | null | null | A row whose picture stays pinned when nothing is hovered or focused. null hides the picture at rest. |
previewWidth / previewHeight | number / number | 128 / 160 | The picture's size in px. The picture always stays inside the list's box. |
...rest | HTMLAttributes | — | Other attributes go to the root <div>. |
Accessibility
- A list of buttons (or links, with href) named by label; the floating picture is decorative and hidden from assistive tech, so put anything people need in the row's text.
- Keyboard: Tab or Up and Down move between rows, focus pins the picture beside the row, Enter opens it, Escape hides the picture. Focus shows a ring on the row.
- Touch: the first tap on a row pins its picture and the second opens it; a tap outside the list puts the picture away.
- Reduced motion places the picture without trailing or leaning, and it appears, changes and goes with a short fade instead of growing, blurring and sliding.
Motion
Follow: exponential easing toward the target at a rate of 12 per second, lean up to 6° from the sideways speed. Appear: scale 0.55 to 1 over --ds-duration-slow on --ds-ease-spring, blur and fade over --ds-duration-base and --ds-duration-fast; leave reverses it on --ds-ease-in. Row change: the new picture resolves over --ds-duration-slow on --ds-ease-out (clip 22% to 0 from top and bottom, blur 10px to 0, scale 1.14 to 1). Band: --ds-duration-base on --ds-ease-out.
Add it to your project
Pro members copy a prompt and their coding agent installs the source, the same way as the free components.
HoverPreviewList.jsxhover-preview-list.csstokens.cssREADME.md
Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.





