DocsSupportPricing
Roadmap (has updates coming soon)XFigma3.7K
Sign inGet All-Access
  1. Components
  2. Scrollspy
  3. Scrollspy Horizontal Nav
DocsMarkdownShare

Shadcn Scrollspy Horizontal Nav

Basic scroll area. Built by composing Button, Scroll Area, Scrollspy. A free, open source shadcn scrollspy example you can install with npx shadcn@latest add @reui/c-scrollspy-2 and edit as your own code.

Basic scroll area

For AI Agents

Hand your agent this brief or the ReUI MCP, not a screenshot. Free to install.

Best for: A horizontal row of 5 section buttons above a full width 400px tall panel

When to use

  • A table of contents that marks which section of a long scrolling panel is in view
  • Jump links that scroll their content to the chosen section and keep that link highlighted

When not to use

  • A narrow column of section links kept beside the content: use the Scrollspy Vertical Nav example
  • A bounded panel with overflow but no links that follow the reader: use the Scroll Area component
  • A chat transcript that opens on the newest turn and follows replies as they stream: use the Message Scroller component
  • Account pages whose side links swap in one panel at a time, hiding the rest: use the Profile blocks

Agent notes

  • nav ids run section-6 to section-10 under labels Section 1 to 5; sections resolve page wide by getElementById, so keep ids unique
  • The Scrollspy row is a flex line with no wrap and its buttons never shrink, so any container narrower than the 5 buttons overflows; let it wrap or scroll
  • Without targetRef the spy tracks nothing and a click only marks its link without scrolling, so always pass one
  • targetRef can sit on a wrapper around a ScrollArea: the spy finds its scroll-area-viewport slot and tracks and scrolls that
  • history is on by default, so mount and every section change rewrite the URL hash with replaceState; pass false to leave it alone
Markdownhttps://reui.io/components/scrollspy/c-scrollspy-2.md
MCPget_example("c-scrollspy-2")
Installnpx shadcn@latest add @reui/c-scrollspy-2
Full index for agents:llms.txtReUI MCP setup

Shadcn Components in Scrollspy Horizontal Nav

  • Button
  • Scroll Area
  • Scrollspy

About Shadcn Scrollspy Horizontal Nav

Basic scroll area. Built by composing Button, Scroll Area, Scrollspy. A free, open source shadcn scrollspy example you can install with npx shadcn@latest add @reui/c-scrollspy-2 and edit as your own code.

What You Can Build With Shadcn Scrollspy Horizontal Nav

  • Composes Button, Scroll Area, Scrollspy, so it drops into any project already using those components.
  • Install it with the shadcn CLI: npx shadcn@latest add @reui/c-scrollspy-2
  • Open source and free, with the full source on this page to copy or adapt.

More Shadcn Scrollspy Examples

  • Vertical Nav Basic scrollspy

Related Shadcn Component Categories

  • Select

    Open-source shadcn select components for form selection, settings menus, and filter controls.

  • Separator

    Open-source shadcn separator components for content grouping, toolbar dividers, and section breaks.

  • Sheet

    Open-source shadcn sheet components for slide-over details, side panels, and task flows.

  • Sidebar

    Open-source shadcn sidebar components for app shells, collapsible side navigation, and dashboard layouts.

  • Signature Pad

    Open-source shadcn signature pad components for e-signature forms, agreements, and proof of delivery.

  • Skeleton

    Open-source shadcn skeleton components for loading placeholders, perceived performance, and content previews.

Frequently Asked Questions

When should I use Shadcn Scrollspy Horizontal Nav?

Use it for a horizontal row of 5 section buttons above a full width 400px tall panel.

Shadcn Scrollspy as a whole fits:

  • A table of contents that marks which section of a long scrolling panel is in view
  • Jump links that scroll their content to the chosen section and keep that link highlighted

For a narrow column of section links kept beside the content, use the Scrollspy Vertical Nav example. For a bounded panel with overflow but no links that follow the reader, use the Scroll Area component. For a chat transcript that opens on the newest turn and follows replies as they stream, use the Message Scroller component. For account pages whose side links swap in one panel at a time, hiding the rest, use the Profile blocks.

How do I install Shadcn Scrollspy Horizontal Nav?

Run npx shadcn@latest add @reui/c-scrollspy-2. The CLI copies the source into your project, so you own the code and can edit it freely.

Is Shadcn Scrollspy Horizontal Nav free to use?

Yes. Every ReUI component example is open source and free for personal and commercial projects.

Which components does Shadcn Scrollspy Horizontal Nav use?

It composes Button, Scroll Area, Scrollspy. The shadcn CLI installs those alongside the example.
PreviousVertical Nav

Start building with ReUI Pro today.

Every Pro block, every style, and every future addition, with one license for unlimited projects.

Get All-Access

From $249, once. Lifetime updates.

Application

  • App ShellAdded 4 new App Shell blocks
  • Auth
  • Card
  • Dashboard
  • Dialog
  • Empty State
  • Event Calendar
  • Flow
  • Form
  • Gantt
  • Kanban Board
  • List
  • Navbar
  • Onboarding
  • Profile
  • Rich Text Editor
  • Schedule
  • Settings
  • Sheet
  • Stats
  • Timeline
  • Whiteboard
  • Wizard

Data Grid

  • Base
  • AdvancedNew Advanced category with 3 Data Grid blocks
  • Columns
  • Drag & Drop
  • Editing
  • Expansion
  • Filtering
  • Grouping
  • Virtualization

Charts

  • Area Chart
  • Bar Chart
  • Composed Chart
  • Line Chart
  • Pie Chart
  • Radial Chart
  • Sparkline
  • Status Tracker

AI & Agents

  • AI Chat
  • Agent Activity

Solutions

  • Dev Ops
  • AI Ops
  • CRM
  • Agents
  • Analytics
  • Billing
  • Bookings
  • Files
  • Inventory
  • Users

Templates

  • E-commerce
  • SaaS
  • Dashboard
  • Landing
  • All templates

eCommerce

  • Category Card
  • Checkout
  • Comparison
  • Coupon
  • Filter Sidebar
  • Product Card
  • Product Detail
  • Product Grid
  • Receipt
  • Review
  • Shopping Cart
  • Wishlist
  • Shop Hero

Marketing

  • Blog
  • Compare
  • Contact
  • CTA
  • FAQ
  • Hero
  • How It Works
  • Pricing

Resources

  • Components
  • Blocks
  • Icons
  • MCP for Agents
  • Docs
  • Support
  • Pricing
  • Tailwind Plus Alternative
  • Roadmap(has updates coming soon)
  • AffiliateSoon

Legal

  • Privacy Policy
  • Terms & Conditions
  • License
  • Refunds
  • Cookies

© 2026 ReUI. All rights reserved.

3.7K