Scrollbar

Thin, hidden or transparent scrollbars, and a stable gutter, across Firefox and WebKit.

Scrollbar utilities for any scroll container. Each one sets both the standard properties (scrollbar-width, scrollbar-color) and the WebKit pseudo-elements, so Firefox and Chromium/Safari agree.

ClassEffect
scrollbar-thinThin scrollbar — 8px in WebKit.
scrollbar-noneHides the scrollbar; the container still scrolls.
no-scrollbarAlias of scrollbar-none.
scrollbar-gutter-stableReserves the gutter, so content does not shift when it appears.
scrollbar-thumb-transparentMakes the thumb transparent.
scrollbar-track-transparentMakes the track transparent.
contain-contentcontain: content — an isolation hint for long, busy scrollers.

Examples

Basic

Preview
Code
scrollbar-thin
Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7
Row 8
Row 9
Row 10
Row 11
Row 12
Row 13
Row 14
Row 15
Row 16
Row 17
Row 18
Row 19
Row 20
Row 21
Row 22
Row 23
Row 24
no-scrollbar
Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7
Row 8
Row 9
Row 10
Row 11
Row 12
Row 13
Row 14
Row 15
Row 16
Row 17
Row 18
Row 19
Row 20
Row 21
Row 22
Row 23
Row 24
scrollbar-gutter-stable
Row 1
Row 2
Row 3

Hiding the scrollbar while scrolling

The transparent utilities are variant-composable, which is how MessageScroller fades its scrollbar out during an autoscroll and back in when the reader takes over:

<div
  class="overflow-y-auto scrollbar-thin data-[autoscrolling]:scrollbar-thumb-transparent"
  :data-autoscrolling="autoscrolling ? '' : undefined"
/>