Skip to content

Layout

This guide covers utilities for controlling the layout of your site, including display, positioning, z-index, and overflow.

Display

The display utilities allow you to control the display property of an element, which is fundamental to how it behaves in the layout.

ClassCSSUse Case
is-hiddendisplay: none;Completely removes the element from the page.
is-blockdisplay: block;The element starts on a new line and takes up the full width available.
is-inlinedisplay: inline;The element does not start on a new line and only takes up as much width as necessary.
is-inline-blockdisplay: inline-block;Like inline, but you can set a width and height on the element.
is-flexdisplay: flex;Enables flexbox layout. See the Flexbox guide for more details.
is-inline-flexdisplay: inline-flex;An inline-level version of flexbox.

Example:

html
<!-- Hide an element by default, but show it on medium screens -->
<div class="is-hidden md:is-block">...</div>

Positioning

Control how an element is positioned within the document or its parent.

ClassCSSUse Case
is-relativeposition: relative;The element is positioned according to the normal flow of the document. Required for absolute positioning of children.
is-absoluteposition: absolute;The element is removed from the normal flow and positioned relative to its nearest positioned ancestor.
is-fixedposition: fixed;The element is positioned relative to the viewport, meaning it always stays in the same place even if the page is scrolled.
is-stickyposition: sticky;A hybrid of relative and fixed. It's treated as relative until it crosses a specified threshold, at which point it becomes fixed.
is-navposition: sticky; top: 0; z-index: 999;A pre-built utility for creating sticky navigation bars.

Placement

These utilities are used with absolute, fixed, or sticky positioned elements to place them on the page.

ClassCSS
is-top-0top: 0;
is-bottom-0bottom: 0;
is-left-0left: 0;
is-right-0right: 0;

Example:

html
<!-- A close button in the top-right corner of a card -->
<div class="is-relative is-p-4">
  <button class="is-absolute is-top-0 is-right-0">X</button>
  <p>Card content...</p>
</div>

Z-Index

Control the stacking order of positioned elements.

ClassCSS
is-z-0z-index: 0;
is-z-50z-index: 50;
is-z-100z-index: 100;

NOTE

Arbitrary values are supported for z-index: is-z-[999]

Overflow

Control how content that overflows an element's box is handled.

ClassCSSUse Case
is-overflow-autooverflow: auto;Adds scrollbars only when content overflows.
is-overflow-hiddenoverflow: hidden;Clips the overflowing content. It is not visible.
is-overflow-visibleoverflow: visible;The overflowing content is rendered outside the element's box. (Default)
is-overflow-scrolloverflow: scroll;Always shows scrollbars, even if content does not overflow.
is-overflow-x-scrolloverflow-x: scroll;Enables horizontal scrolling.
is-overflow-y-scrolloverflow-y: scroll;Enables vertical scrolling.

Aspect Ratio

Control the aspect ratio of an element.

ClassCSSUse Case
is-aspect-autoaspect-ratio: auto;The browser calculates the aspect ratio.
is-aspect-squareaspect-ratio: 1 / 1;Creates a perfect square.
is-aspect-videoaspect-ratio: 16 / 9;Creates a 16:9 video container.

Example:

html
<!-- A responsive video embed -->
<div class="is-aspect-video">
  <iframe src="..." class="is-w-full is-h-full"></iframe>
</div>