Overflow
Utilities for controlling how an element handles content that is too large for the container.
Class | Properties |
---|---|
.overflow-auto | overflow: auto; |
.overflow-hidden | overflow: hidden; |
.overflow-visible | overflow: visible; |
.overflow-scroll | overflow: scroll; |
.overflow-x-auto | overflow-x: auto; |
.overflow-y-auto | overflow-y: auto; |
.overflow-x-hidden | overflow-x: hidden; |
.overflow-y-hidden | overflow-y: hidden; |
.overflow-x-visible | overflow-x: visble; |
.overflow-y-visible | overflow-y: visible; |
.overflow-x-scroll | overflow-x: scroll; |
.overflow-y-scroll | overflow-y: scroll; |
.scrolling-touch | -webkit-overflow-scrolling: touch; |
Auto
Use .overflow-auto
to add scrollbars to an element in the event that its content overflows the bounds of that element. Unlike .overflow-scroll
, which always show scrollbars, this utility will only show them if scrolling is necessary.
Hidden
Use .overflow-hidden
to clip any content within an element that overflows the bounds of that element.
Scroll horizontally if needed
Use .overflow-x-auto
to allow horizontal scrolling if needed.
Scroll vertically if needed
Use .overflow-y-auto
to allow vertical scrolling if needed.
Scroll horizontally always
Use .overflow-x-scroll
to allow horizontal scrolling and always show scrollbars unless always-visible scrollbars are disabled by the operating system.
Scroll vertically always
Use .overflow-y-scroll
to allow vertical scrolling and always show scrollbars unless always-visible scrollbars are disabled by the operating system.
Scroll in all directions
Use .overflow-scroll
to add scrollbars to an element. Unlike .overflow-auto
, which only shows scrollbars if they are necessary, this utility always shows them. Note that some operating systems (like macOS) hide unnecessary scrollbars regardless of this setting.
Scroll horizontally when content can't wrap
Scroll vertically when content can wrap
Scroll both horizontally and vertically when some content can't wrap
Momentum-based scrolling on touch devices
Use .scrolling-touch
to use momentum-based scrolling (where supported) on touch devices.
Responsive
To control the overflow behaviour at a specific breakpoint, add @{breakpoint}
to any existing overflow utility.
Variants
By default, only responsive variants are generated for this utility. You can control which variants are generated by modifying the $utility-configuration
in _settings.scss.