Navigation list

Navigation list

A sidebar with a current page. The background rests there and leaves only while you point elsewhere.

import { createMovingHighlight } from "@reuse-sh/interactions";

// The current page carries data-current. The highlight rests there
// and follows the pointer or focus while they are inside the list.
const nav = document.querySelector(".sidebar");
const highlight = createMovingHighlight(nav);