CSS Scrollbar Generator
Generate custom styled scrollbar CSS for WebKit and Firefox with live preview, presets, and one-click copy.
Updated
What is the CSS Scrollbar Generator?
The CSS Scrollbar Generator is a free, browser-based tool that lets you design custom scrollbar styles visually and export clean, cross-browser CSS in seconds. No DevTools guesswork, no memorizing pseudo-element syntax — just adjust sliders and color pickers while a live preview updates in real time.
Default browser scrollbars are functional but rarely match a modern website's visual design. Dark-mode dashboards, branded SaaS apps, and editorial layouts all benefit from scrollbars that feel integrated rather than bolted on. This generator handles the two incompatible CSS approaches for you: the ::-webkit-scrollbar pseudo-element API for Chrome, Safari, and Edge, plus the standardized scrollbar-color and scrollbar-width properties for Firefox.
What You Can Customize
- Width & height — control scrollbar thickness from 0px (hidden) up to 50px
- Thumb color — the draggable handle that users grab
- Track color — the background rail the thumb moves along
- Border radius — round the corners of both thumb and track independently
- Borders — add stroke widths and colors to thumb and track for layered effects
- Hover & active states — define distinct colors for mouse interaction feedback
- Scrollbar buttons — optional arrow buttons with their own color states
- Corner styling — the junction where vertical and horizontal scrollbars meet
- Firefox width — choose
auto,thin, ornonefor the standard property - CSS selector — scope styles to a class, ID, or element of your choice
Built-In Presets
Jump-start your design with one of seven professionally tuned presets:
| Preset | Description |
|---|---|
| Default | Classic gray thumb on light track — the safe starting point |
| Minimal | Ultra-slim 6px scrollbar with subtle slate tones |
| Rounded | Soft 10px radius with a floating white border around a blue thumb |
| Dark | Charcoal track with medium-gray thumb for night-mode UIs |
| Neon | Cyan thumb on deep navy for gaming or creative portfolios |
| macOS | Transparent track with semi-transparent black thumb like native macOS |
| Hidden | Zero-width scrollbar that preserves scroll functionality |
Browser Support
The generator outputs both syntaxes so your scrollbars look consistent across all modern browsers:
- WebKit/Blink — Chrome, Edge, Safari, Opera, Brave (full
::-webkit-scrollbarsupport) - Firefox —
scrollbar-widthandscrollbar-colorstandard properties - Mobile — overlay scrollbars on iOS and Android generally ignore custom styling, but the CSS won't break anything
Everything runs entirely in your browser. No data is uploaded, no account is required, and the generated CSS is ready to paste directly into your stylesheet.
How it works
This tool is built around the reality that modern browsers implement scrollbar styling through two completely different CSS APIs. Rather than forcing you to memorize both, the generator produces the correct rules for each engine from a single set of visual controls.
The Two CSS Approaches
WebKit Pseudo-Elements (Chrome, Safari, Edge, Opera)
WebKit-based browsers expose scrollbar parts as CSS pseudo-elements. Each part can be styled independently:
::-webkit-scrollbar— the scrollbar container itself (sets width and height)::-webkit-scrollbar-track— the background rail behind the thumb::-webkit-scrollbar-thumb— the draggable handle::-webkit-scrollbar-thumb:hover— thumb appearance on mouse hover::-webkit-scrollbar-thumb:active— thumb appearance while being dragged::-webkit-scrollbar-button— the directional arrow buttons at each end::-webkit-scrollbar-corner— the intersection of vertical and horizontal scrollbars
This approach gives you fine-grained control over every visual detail: colors, border radius, borders, and individual states.
Standard Properties (Firefox, and newer Chrome)
The W3C CSS Scrollbars Styling Module Level 1 defines two standardized properties:
scrollbar-width: auto | thin | none— controls thicknessscrollbar-color: thumb-color track-color— sets both colors in one declaration
Firefox has supported these since version 64. Chrome and Edge added support in version 121. These properties are simpler but do not support border radius, borders, or hover states.
What the Generator Does
When you adjust any control, the tool immediately:
- Validates your input — checks that colors are valid hex codes, widths are within bounds, and selectors are non-empty
- Builds the WebKit CSS — constructs the full pseudo-element rule set with only the properties you have customized, avoiding unnecessary declarations
- Builds the Firefox CSS — generates the
scrollbar-widthandscrollbar-colordeclaration scoped to your chosen selector - Combines both outputs — based on your selected output mode (
Both,WebKit Only, orFirefox Only), merges the rules into a single copy-ready block - Updates the live preview — injects the generated CSS into a style tag so you can scroll the preview panel and see your design in action
Live Preview Engine
The preview panel is a real scrollable container with enough content to trigger overflow. It uses the exact CSS the generator produces, so what you see is what you get. The preview supports:
- Vertical scrolling with your custom thumb and track
- Horizontal scrolling when the horizontal scrollbar option is enabled
- Hover state testing by moving your mouse over the thumb
- Firefox fallback rendering via inline
scrollbar-colorandscrollbar-widthstyles
Output Modes
Choose how much CSS you want to copy:
| Mode | Use Case |
|---|---|
| Both | Maximum compatibility — paste once and cover all modern browsers |
| WebKit Only | You only target Chrome, Edge, and Safari; want smaller CSS |
| Firefox Only | You only target Firefox; want the standard syntax |
Preset System
Presets are pre-tuned configurations stored as partial objects. When you select a preset, the generator merges its values into your current configuration, overwriting only the properties the preset defines. This lets you start from a preset and then fine-tune individual controls without losing your other settings.
Validation & Error Handling
Every numeric input is clamped to safe ranges (0–50px for dimensions, 0–20px for borders, 0–50px for radius). Color fields validate hex format. If any value is invalid, the generator surfaces a clear human-readable error message instead of producing broken CSS.
Export Options
Once you are satisfied with your design, you can:
- Copy to clipboard — one click copies the full CSS block, ready to paste into your stylesheet
- Download as .css file — exports the generated code as a downloadable file named
scrollbar.css
All processing happens client-side in your browser. No network requests are made and no data leaves your machine.
Examples
Minimal thin scrollbar
A slim 6px scrollbar with subtle gray thumb and light track, perfect for clean modern interfaces.
Dark mode scrollbar
A dark-themed scrollbar with charcoal track and medium-gray thumb for night-mode dashboards.
Hidden scrollbar
Completely hides the scrollbar while preserving scroll functionality — useful for horizontal galleries.
Rounded blue scrollbar with border
A polished rounded scrollbar with a white border around the thumb for a floating effect.
Neon cyan scrollbar
A bold neon-style scrollbar with cyan thumb on a dark navy track for gaming or creative sites.
Frequently asked questions
Which browsers support custom CSS scrollbars?
Which browsers support custom CSS scrollbars?
Modern Chrome, Edge, Safari, and Opera support the ::-webkit-scrollbar pseudo-elements for full customization. Firefox supports the standardized scrollbar-width and scrollbar-color properties. Internet Explorer does not support scrollbar styling at all. This generator outputs CSS for both WebKit and Firefox so your styles work across all modern browsers.
What is the difference between WebKit and Firefox scrollbar styling?
What is the difference between WebKit and Firefox scrollbar styling?
WebKit browsers (Chrome, Safari, Edge) let you style every scrollbar part independently using pseudo-elements like ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-track, and ::-webkit-scrollbar-corner. You can set custom widths, colors, border radius, borders, and hover states. Firefox uses the simpler scrollbar-color and scrollbar-width properties, which only let you change the thumb color, track color, and overall width (auto, thin, or none). The generator creates both sets of rules automatically.
Can I hide the scrollbar but keep scrolling functionality?
Can I hide the scrollbar but keep scrolling functionality?
Yes. Set the Width slider to 0 and choose Firefox Width → none. The generator will output ::-webkit-scrollbar { display: none; } for WebKit and scrollbar-width: none; for Firefox. This hides the visual scrollbar while preserving mouse wheel, touch, and keyboard scrolling. This is commonly used for horizontal image galleries and carousel components.
Why does my custom scrollbar not show up on mobile?
Why does my custom scrollbar not show up on mobile?
Mobile browsers, especially on iOS and Android, use overlay scrollbars that appear temporarily while scrolling and then fade away. These overlay scrollbars generally ignore custom CSS styling. The good news is that your CSS won't break anything on mobile — users will simply see the native overlay scrollbar. If you need custom scrollbars on mobile, you typically need a JavaScript library instead of pure CSS.
Can I use transparent or semi-transparent colors?
Can I use transparent or semi-transparent colors?
Yes. The color pickers output hex codes by default, but you can manually edit the generated CSS to use rgba() or hsla() values for transparency. For example, rgba(0, 0, 0, 0.25) creates a semi-transparent black thumb. The macOS preset in this generator uses transparent track colors to achieve the native floating-thumb effect.
How do I apply the generated CSS to a specific element?
How do I apply the generated CSS to a specific element?
Change the CSS Selector field from .custom-scrollbar to any valid CSS selector. Common examples include .sidebar for a navigation panel, #chat-box for a messaging container, or body to style the entire page scrollbar. The generator scopes all generated rules to whatever selector you provide.
What are hover and active states for?
What are hover and active states for?
Hover state changes the thumb color when the user moves their mouse over it, providing visual feedback that the scrollbar is interactive. Active state changes the thumb color while the user is actively dragging it. These states only work in WebKit browsers — Firefox does not expose hover or active states for scrollbars through the standard properties. You can toggle these states on or off in the generator to include or exclude them from the output.
What are scrollbar buttons?
What are scrollbar buttons?
Scrollbar buttons are the small arrow buttons at the top and bottom (or left and right) ends of a scrollbar. They let users scroll by clicking rather than dragging. WebKit browsers support styling these buttons with ::-webkit-scrollbar-button, but they are hidden by default in most modern designs. The generator lets you enable them and set custom colors for their default, hover, and active states.
Does custom scrollbar CSS affect performance?
Does custom scrollbar CSS affect performance?
No. Custom scrollbar CSS has negligible impact on rendering performance. The styles are pure CSS pseudo-elements and properties — no JavaScript, no animations, no repaints beyond what the browser already does for native scrollbars. The only consideration is that very thick scrollbars (width > 20px) consume more layout space, which could affect container sizing in rare cases.
Why does Firefox not show border radius on my scrollbar?
Why does Firefox not show border radius on my scrollbar?
Firefox's scrollbar-color and scrollbar-width properties do not support border radius, borders, or hover states. This is a limitation of the CSS specification, not the generator. If you need rounded scrollbar thumbs in Firefox, there is currently no pure-CSS solution — you would need a JavaScript custom scrollbar library. The generator still outputs the standard Firefox properties so your colors and width are consistent, while WebKit browsers render the full visual design.
Can I animate scrollbar colors with CSS transitions?
Can I animate scrollbar colors with CSS transitions?
Technically yes for WebKit browsers — you can add transition: background 0.2s ease to ::-webkit-scrollbar-thumb. However, this is generally discouraged because scrollbar pseudo-elements are non-standard and transition support varies. The generator does not include transitions by default to keep the output safe and predictable. If you want animated scrollbars, add the transition property manually after copying the CSS.
What is the scrollbar corner?
What is the scrollbar corner?
The scrollbar corner is the small square where a vertical scrollbar and a horizontal scrollbar meet, typically in the bottom-right corner of a scrollable container. By default it inherits the track color. The generator lets you set a custom color for this corner using the Corner Color control, which maps to the ::-webkit-scrollbar-corner pseudo-element.
Is the generated CSS valid and production-ready?
Is the generated CSS valid and production-ready?
Yes. The generator produces clean, well-formatted CSS with proper indentation and optional section comments. It only includes properties you have actually customized, avoiding unnecessary declarations. The output follows current best practices: it uses the standard scrollbar-* properties alongside the WebKit fallback for maximum compatibility. You can paste the code directly into your stylesheet, CSS-in-JS solution, or component scoped styles.
Related tools
More utilities you might find handy.
Box Model Visualizer
Interactive CSS box model visualizer with real-time editing of margin, border, padding, and content dimensions
CSS Animation Generator
Generate CSS keyframe animation code
CSS Button Generator
Design and generate custom CSS button styles with live preview and instant code export.