Skip to content
0

Overflow Direction ​

Control overflow behavior independently on the horizontal (x) and vertical (y) axes.

Quick Reference ​

ClassProperties
.overflow-x-autooverflow-x: auto
.overflow-x-hiddenoverflow-x: hidden
.overflow-x-clipoverflow-x: clip
.overflow-x-visibleoverflow-x: visible
.overflow-x-scrolloverflow-x: scroll
.overflow-y-autooverflow-y: auto
.overflow-y-hiddenoverflow-y: hidden
.overflow-y-clipoverflow-y: clip
.overflow-y-visibleoverflow-y: visible
.overflow-y-scrolloverflow-y: scroll

Basic Usage ​

html
<!-- Horizontal scrolling only -->
<div class="overflow-x-auto whitespace-nowrap">
  <span class="inline-block w-64">Wide content...</span>
</div>

<!-- Vertical scrolling only -->
<div class="overflow-y-auto h-64">
  <p>Long content that scrolls vertically...</p>
</div>

<!-- Hide horizontal overflow, allow vertical scroll -->
<div class="overflow-x-hidden overflow-y-auto h-64">
  <p>Content here...</p>
</div>

Comparison with Overflow ​

ClassX AxisY Axis
.overflow-autoautoauto
.overflow-hiddenhiddenhidden
.overflow-x-autoauto(unchanged)
.overflow-y-hidden(unchanged)hidden

TIP

Use directional overflow utilities when you need different behavior on each axis, e.g., horizontal scrolling for a wide table while keeping vertical overflow visible.

SCSS Source ​

scss
// From _utilities.scss — $overflow-xy-list
$overflow-xy-list: (auto, hidden, clip, visible, scroll) !default;

Released under the MIT License.