Scrollbars
A scrollbar shows position in scrollable content without claiming layout space of its own. Apply .p-scrollbar to any scroll container, or to <body> for the whole page.
Preview
Anatomy
The scrollbar is a capsule thumb with no track, the same weight as the native overlay scroller.
| Part | Value |
|---|---|
| Thumb thickness | 6px |
| Thumb radius | 3px, a full capsule |
| Gutter (also the hover target) | 14px, with a 4px transparent border on each side |
| Minimum thumb length | 29px |
| State | Value |
|---|---|
| Rest | rgba(0, 0, 0, 0.5) |
| Hover / drag | rgba(0, 0, 0, 0.62) |
| Dark rest | rgba(255, 255, 255, 0.5) |
| Dark hover / drag | rgba(255, 255, 255, 0.62) |
Dark mode mirrors the light values in white, so the thumb reads equally well on dark and elevated dark surfaces. Both .p-dark-mode and .p-auto-dark-mode are supported.
Browser support
WebKit and Blink browsers get the full treatment through ::-webkit-scrollbar. Firefox does not expose thumb geometry, so it receives scrollbar-width: thin with scrollbar-color matching the same rest colors. Both render a quiet, trackless bar; only the exact thickness differs.
Code
<div class="p-scrollbar" style="height: 300px; overflow-y: auto;">
<!-- long content -->
</div>
Consider keeping scrollbars visible when content overflows. Overlay bars that only appear during scrolling hide the fact that content continues, and people without trackpads rely on the thumb as a drag target.