Scroll this panel to see your custom scrollbar. Adjust controls on the left — the scrollbar updates in real time.

CSS custom scrollbars use ::-webkit-scrollbar pseudo-elements for Chrome, Edge and Safari, and scrollbar-color for Firefox.

Thin scrollbars (2–6px) are a popular modern pattern — they save space while still indicating scrollable content. Thicker scrollbars are useful for touch-heavy interfaces.

The track is the groove the thumb slides in. Setting it to transparent makes the scrollbar appear to float over the content. A solid track color gives more visual weight.

The hover color applies when the user moves their cursor over the scrollbar thumb — a subtle color shift signals interactivity without being distracting.

Custom scrollbars are most impactful on dark-themed UIs, code editors, sidebars and modals with fixed heights. Mobile browsers typically ignore custom scrollbar styles.

Border radius on the thumb and track creates a pill-shaped scrollbar. Set radius to 0 for a sharp, utilitarian look. Half the width value gives a fully rounded pill.

Always test scrollbar contrast against the track background — users with low vision need sufficient difference between thumb and track colors to use it comfortably.

Generated CSS

CSS Scrollbar Styler

Custom CSS scrollbars let you replace the browser's default scrollbar appearance with a design that matches your UI. The ::-webkit-scrollbar family of pseudo-elements works in Chrome, Edge and Safari. Firefox uses the simpler scrollbar-color and scrollbar-width properties.

The CSS Scrollbar Properties

Pseudo-element / PropertyWhat it stylesBrowser
::-webkit-scrollbarWidth/height of the scrollbarChrome, Edge, Safari
::-webkit-scrollbar-trackThe background trackChrome, Edge, Safari
::-webkit-scrollbar-thumbThe draggable thumbChrome, Edge, Safari
::-webkit-scrollbar-thumb:hoverThumb on hoverChrome, Edge, Safari
scrollbar-widththin, auto, or noneFirefox
scrollbar-colorthumb color track colorFirefox

Complete Cross-Browser Example

/* Chrome, Edge, Safari */
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-track { background: #1c1c28; border-radius: 3px; }
.scrollable::-webkit-scrollbar-thumb { background: #7c6fff; border-radius: 3px; }
.scrollable::-webkit-scrollbar-thumb:hover { background: #ff6fb0; }

/* Firefox */
.scrollable {
  scrollbar-width: thin;
  scrollbar-color: #7c6fff #1c1c28;
}

Frequently Asked Questions

Does CSS scrollbar styling work in Firefox?

Firefox supports scrollbar-color and scrollbar-width — simple two-value properties that set the thumb and track color. It does not support ::-webkit-scrollbar pseudo-elements. The generated CSS includes both approaches for full coverage.

How do I hide the scrollbar but keep scrolling?

Use scrollbar-width: none (Firefox) and ::-webkit-scrollbar { display: none; } (Chrome/Safari). The element remains scrollable but the scrollbar is invisible. Use with caution — hidden scrollbars can confuse users.

Why does my styled scrollbar not show on mobile?

Mobile browsers (iOS Safari, Android Chrome) use overlay scrollbars that disappear after scrolling stops. Custom scrollbar styles are largely ignored on mobile. This is expected browser behaviour.

Related tools: CSS Filter Generator · Glassmorphism Generator

Tool last updated: