Interactivity
Utilities for controlling the gutter space reserved for an element's scrollbar.
| Class | Styles |
|---|---|
scrollbar-gutter-auto | scrollbar-gutter: auto; |
scrollbar-gutter-stable | scrollbar-gutter: stable; |
scrollbar-gutter-both | scrollbar-gutter: stable both-edges; |
Use the scrollbar-gutter-stable utility to reserve space for the scrollbar even when an element isn't overflowing:
scrollbar-gutter-auto
scrollbar-gutter-stable
<div class="overflow-auto scrollbar-gutter-stable ..."> <!-- ... --></div>Use the scrollbar-gutter-both utility to reserve matching gutter space on both sides of the element:
<div class="overflow-auto scrollbar-gutter-both ..."> <!-- ... --></div>Use the scrollbar-gutter-auto utility to only reserve gutter space when the browser would normally show a scrollbar:
<div class="overflow-auto scrollbar-gutter-auto ..."> <!-- ... --></div>Prefix a scrollbar-gutter utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<div class="scrollbar-gutter-auto md:scrollbar-gutter-stable ..."> <!-- ... --></div>Learn more about using variants in the variants documentation.