Desktop components

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

Scroll me. The thumb is a 6px capsule with no track behind it.

It rides in a 14px gutter, so content keeps a consistent inset.

The thumb is black at 50%, and darkens to 62% on hover.

The minimum thumb length is 29px, so it never collapses to a dot.

In dark mode the thumb flips to white at 50%.

Firefox gets the thin native scrollbar in the same colors.

Horizontal works the same way: a 6px tall capsule thumb in a transparent track. Scroll sideways to see it.

Anatomy

The scrollbar is a capsule thumb with no track, the same weight as the native overlay scroller.

PartValue
Thumb thickness6px
Thumb radius3px, a full capsule
Gutter (also the hover target)14px, with a 4px transparent border on each side
Minimum thumb length29px
StateValue
Restrgba(0, 0, 0, 0.5)
Hover / dragrgba(0, 0, 0, 0.62)
Dark restrgba(255, 255, 255, 0.5)
Dark hover / dragrgba(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.

Copied