API

API

The browser module exports createMovingHighlight. The React package adds MovingHighlight.

NameDescription
createMovingHighlight(root, options?)Adds one background that moves between the rows inside root. Returns refresh and destroy.
mode"hover" follows the pointer and focus and rests on the selected row. "selected" stays on the selected row and moves only when the selection changes. "hover" by default.
rowSelector, selectedSelectorWhich elements are rows, [data-reuse-row] by default, and which one is selected: data-current, aria-selected or data-highlighted.
classNameAdded to the background element. Use it to tell two highlights on one root apart.
MovingHighlightThe React wrapper around the same controller. highlightClassName sets the background's class.