Browse documentation

Reference / Sizing

Max height

Cap the height of a long panel, menu or list. Combine the cap with an overflow utility to keep every entry reachable.

Working example

Short lists occupy their natural height. Longer lists can scroll once their content reaches the maximum.

HTML
<ol tabindex="0" aria-label="Production stages" class="max-h-16 overflow-y-auto border px-2">
  <li class="py-1">Draft</li>
  <li class="py-1">Proof</li>
  <li class="py-1">Print</li>
  <li class="py-1">Bind</li>
</ol>

Class reference

ClassCSS declarations
max-h-16max-height: 4rem;
max-h-32max-height: 8rem;
max-h-fullmax-height: 100%;
max-h-screenmax-height: 100vh;
max-h-dvhmax-height: 100dvh;
max-h-nonemax-height: none;
max-h-[10rem]max-height: 10rem;
View full generated CSS
Compiled CSS
.max-h-16 {
  max-height: 4rem;
}
.max-h-32 {
  max-height: 8rem;
}
.max-h-\[10rem\] {
  max-height: 10rem;
}
.max-h-dvh {
  max-height: 100dvh;
}
.max-h-full {
  max-height: 100%;
}
.max-h-none {
  max-height: none;
}
.max-h-screen {
  max-height: 100vh;
}