Skip to content
Navigation

ScrollNav

A section list that follows your reading. The rail fills as you scroll, the marker glides to the section you are in, and a click scrolls there smoothly.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
items{ label, href }[]โ€”One link per section. href = "#" + the section id.
containerRefObject<HTMLElement>โ€”Scrolling box that holds the sections. Leave out to use the page.
offsetnumber80Pixels from the top where a section counts as reached (e.g. sticky header height).
onSelect(item, e) => voidโ€”Called after the smooth scroll starts.
orientation"vertical" | "horizontal""vertical"Column with a side rail, or row with a bottom rail.
accentstring"#a78bfa"Rail and marker colour.
labelstring"On this page"Name read out by screen readers.
classNamestring"text-sm text-white/55"Text size and colour.