Skip to content
Premium & Brand

Scroll Nav

Sticky sidebar that highlights the section in view as you scroll.

Import

tsx
import { ScrollNav } from "@cronus-ui/ui";
bash
npx cronus-ui add scroll-nav

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component ScrollNavDefault layout:inline style:scroll-nav {
  label "Terms & Conditions"
  text "Acceptance" -> "#acceptance"
  text "By using the service you agree to these terms."
  text "Privacy" -> "#privacy"
  text "We store only what the product needs."
}

page "/audit/scroll-nav/default" type:custom {
  use ScrollNavDefault
}

API Reference

Generated from the component's exported types.

ScrollNavLabels

Skip ScrollNavLabels props table
PropTypeDefaultDescription
nav*
string—Accessible name for the sticky section list.

ScrollNavProps

Extends Omit< ComponentPropsWithoutRef<"div">, "title" | "onAnimationStart" | "onAnimationEnd" | "onDrag" | "onDragStart" | "onDragEnd" >

Skip ScrollNavProps props table
PropTypeDefaultDescription
ref
Ref<HTMLDivElement>—Ref forwarded to the underlying DOM node.
title
string"Terms & Conditions"Page heading.
terms*
ScrollNavTerm[]——
viewportRef
RefObject<HTMLElement | null>—Scroll container. When set, the spy observes this box instead of the viewport — needed when the nav lives inside a nested scroller (docs preview).
labels
Partial<ScrollNavLabels>—Override default English strings.
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.