Scroll this area to see your custom scrollbar in action. Adjust the controls on the left to change the width, color, radius and opacity of the scrollbar thumb and track.
CSS scrollbars are styled using two APIs: the WebKit pseudo-element approach (::-webkit-scrollbar) for Chrome, Edge, and Safari, and the W3C standard scrollbar-color and scrollbar-width properties for Firefox.
Both APIs are output below — copy both blocks and include them in your stylesheet for maximum cross-browser coverage.
Thin scrollbars with subtle colors are best for most UIs. Wider scrollbars improve accessibility — WCAG recommends interactive targets be at least 24px.
Mobile browsers generally ignore custom scrollbar styles. This is primarily a desktop feature.
On macOS, scrollbars are hidden by default and only appear on scroll. On Windows they always take up layout space.
Keep scrolling to test behaviour through the full scroll range.