YouTip LogoYouTip

Bootstrap5 Scrollspy

## Bootstrap5 Scrollspy Scrollspy plugin, also known as automatic navigation update plugin, automatically updates the corresponding navigation target based on the scrollbar position. Its basic implementation is based on your scrolling. * * * ## How to Create Scrollspy The following example demonstrates how to create a scrollspy: ## Example

Section 1

Try to scroll this page and look at the navigation bar while scrolling!

... [Try it Β»](#) ### Example Explanation Add data-bs-spy="scroll" to the element you want to spy on (usually body). Then add the data-bs-target attribute, whose value is the id or class of the navbar (.navbar). This connects to the scrollable area. Note: The id on the scrollable item element (
← Bootstrap5 UtilitiesBootstrap5 Tooltip β†’