Utilities
Display
How an element sits on the page: a block, a row of things (flex), a grid — or not at all.
flex
flex
flex
<div class="flex gap-2">…</div>
inline-block inline-block
block
<span class="inline-block">inline-block</span>
<span class="inline-block">inline-block</span>
<div class="block mt-2">block</div>
Show and hide by screen size
hidden hides on every screen; combine it with a breakpoint to show something only where it fits.
always
sm and up
lg and up
below lg
<div class="flex gap-2">
<div>always</div>
<div class="hidden sm:block">sm and up</div>
<div class="hidden lg:block">lg and up</div>
<div class="lg:hidden">below lg</div>
</div>
To hide something but keep it for screen readers, use visually-hidden instead.
Every value
Inline things sit in a line of text; block things take the whole row; inline-flex is a row of things that sits inline; flow-root holds a float.
A sentence with an inline box and an inline-block box in it.
block takes the whole row
inline-flex
float
flow-root keeps the float inside its box.<div class="space-y-3">
<p class="m-0">A sentence with an <span class="inline">inline</span> box and an <span class="inline-block">inline-block</span> box in it.</p>
<div class="block">block takes the whole row</div>
<span class="inline-flex items-center gap-2">inline-flex <i class="mi mi-arrow-right"></i></span>
<div class="flow-root bg-1 rounded p-2">
<div class="float-start me-2">float</div>
flow-root keeps the float inside its box.
</div>
</div>