Tailwind CSS Custom Scrollbar
Style WebKit custom scrollbars and native Tailwind CSS scrollbar utilities for width, gutter spacing, and colors.
Custom scrollbars
Use these WebKit scrollbar selector examples when you need visible custom scrollbars, rounded thumbs, or Preline theme scrollbar tokens.
Basic usage
This example creates a thin scrollbar with a themed track [&::-webkit-scrollbar-track]:bg-scrollbar-track and thumb [&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb.
Rounded corners
Add rounded corners to the scrollbar track [&::-webkit-scrollbar-track]:rounded-full and thumb [&::-webkit-scrollbar-thumb]:rounded-full.
Native Tailwind utilities
Tailwind CSS v4.3 includes native scrollbar utilities for standards-based width, gutter spacing, and colors. Use these when native browser behavior is enough, and keep the custom examples above for WebKit-specific styling like rounded scrollbar thumbs.
Scrollbar width
Use scrollbar-auto, scrollbar-thin, and scrollbar-none to control the native scrollbar width.
scrollbar-auto
scrollbar-thin
scrollbar-none
Scrollbar gutter
Use scrollbar-gutter-auto, scrollbar-gutter-stable, and scrollbar-gutter-both to control how much space the browser reserves for a native scrollbar.
scrollbar-gutter-auto
scrollbar-gutter-stable
scrollbar-gutter-both
Scrollbar color
Use utilities like scrollbar-thumb-stone-500 and scrollbar-track-stone-200 to control the native scrollbar colors.