InteractivityScroll Behavior

Scroll Behavior

Controls the scroll behavior of an element.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
sb-autoscroll-behavior: auto;
sb-sscroll-behavior: smooth;

Auto

Initial value

Allows the default scrolling behavior, which is immediate and without any animation.

<div class="sb-auto ..."></div>

Smooth

Enables a smooth scrolling effect, providing a gradual transition when scrolling to a different part of the page.

<div class="sb-s ..."></div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:sb-*, md:sb-*, lg:sb-*, and xxl:sb-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:sb-* utility to override elements and change their values when hovering over them.