Line Nav

Vertical navigation with a line marker that expands on hover and active state.

motion-sv

Installation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/r/line-nav.json

Usage

usage.svelte

Props

LineNav

Animated navigation list for links to page sections.

NameTypeDefaultDescription
itemsLineNavItem[]requiredNavigation items containing a title and href.
activeHrefstringundefinedHref of the currently active item.
scrollActiveIntoViewbooleantrueScrolls the active item into view when the component mounts.
onItemClick(item: LineNavItem, event: MouseEvent) => voidundefinedCalled when a navigation item is clicked.
classstringundefinedAdditional classes applied to the navigation element.