Home/Utilities/Display

Display

Control the display type of elements with responsive variants.

Display values

Use these classes to set the display property of any element. All classes support responsive prefixes (sm:, md:, lg:, xl:).

Class CSS Property Description
.blockdisplay: blockBlock-level element, takes full width
.inline-blockdisplay: inline-blockInline but respects width & height
.inlinedisplay: inlineInline element, flows with text
.flexdisplay: flexBlock-level flex container
.inline-flexdisplay: inline-flexInline flex container
.griddisplay: gridBlock-level grid container
.inline-griddisplay: inline-gridInline grid container
.tabledisplay: tableBehaves like a <table> element
.inline-tabledisplay: inline-tableInline-level table
.table-captiondisplay: table-captionBehaves like a <caption> element
.table-celldisplay: table-cellBehaves like a <td> element
.table-columndisplay: table-columnBehaves like a <col> element
.table-column-groupdisplay: table-column-groupBehaves like a <colgroup> element
.table-footer-groupdisplay: table-footer-groupBehaves like a <tfoot> element
.table-header-groupdisplay: table-header-groupBehaves like a <thead> element
.table-rowdisplay: table-rowBehaves like a <tr> element
.table-row-groupdisplay: table-row-groupBehaves like a <tbody> element
.flow-rootdisplay: flow-rootCreates a new block formatting context
.contentsdisplay: contentsRemoves the element's box, children flow normally
.list-itemdisplay: list-itemRenders with a list-item box and marker
.block - fills the full width .inline-block .inline-block
.inline flows with surrounding .inline text content.
.flex child .flex child .flex child
.grid .grid .grid .grid
<div class="block">Block element</div>
<span class="inline-block">Inline block</span>
<span class="inline">Inline</span>
<div class="flex">...</div>
<div class="grid">...</div>

Hidden

Use .hidden to set display: none !important, completely removing an element from the document flow. Use .show to reset it back to its default display value.

Note: .hidden uses !important and will override other display utilities. Use responsive variants like md:hidden to conditionally hide elements at specific breakpoints.
Visible element .hidden - not rendered Visible element
<!-- Hide an element completely -->
<div class="hidden">Not rendered</div>

<!-- Reset display -->
<div class="show">Visible again</div>

Responsive visibility

All display utilities accept responsive prefixes following ArchCSS's mobile-first breakpoint system. Prefix any display class with a breakpoint to apply it at that screen size and above.

Prefix Breakpoint Applies at
noneAll screensAlways applied
sm:≥ 576pxSmall devices and up
md:≥ 768pxMedium devices and up
lg:≥ 992pxLarge devices and up
xl:≥ 1200pxExtra-large devices and up

Common responsive patterns:

Class Behaviour
hidden md:blockHidden on mobile, block from md up
block md:hiddenVisible on mobile, hidden from md up
hidden lg:flexHidden until lg, then flex
flex md:gridFlex on mobile, grid from md up
sm:flexFlex from sm breakpoint up
lg:hiddenHides element from lg breakpoint up
Always visible Hidden on mobile (md:block) Mobile only (md:hidden)
<!-- Nav that collapses on mobile -->
<nav class="flex">
  <a href="/">Logo</a>

  <!-- Hidden on mobile, shown from md up -->
  <ul class="hidden md:flex">
    <li><a href="/about">About</a></li>
    <li><a href="/docs">Docs</a></li>
  </ul>

  <!-- Hamburger: visible on mobile only -->
  <button class="block md:hidden">Menu</button>
</nav>