Last updated: 11 May 2024

Tailwind CSS Invisibility

The tailwind invisible utility class allows you to hide an element from the layout while still occupying space in the document flow.


Tailwind Invisibility

The tailwind invisible utility class allows you to hide an element from the layout while still occupying space in the document flow. With Tailwind's invisible class, you can make an element invisible to the user, but it will still be present in the DOM and affect the positioning of other elements.

Applying Invisibility

To make an element invisible, you can simply apply the invisible utility class to it. Here's an example:

html
<div class="invisible">
A
</div>
<div class="bg-red-500">
B
</div>
<div class="bg-red-500">
C
</div>

Preview

B
C

Responsive Invisibility

Tailwind CSS allows you to apply the invisible class responsively at different breakpoints. To use responsive invisibility, you can append the breakpoint prefix to the utility class. For example, md:invisible makes the element invisible starting from the medium breakpoint and above.

html
<div class="invisible md:visible">
This element is invisible by default, but starting from the medium breakpoint and above, it
becomes visible.
</div>

In the above example, the element is invisible by default (invisible), but starting from the medium breakpoint and above, it becomes visible (md:visible).

Tailwind Invisibility Class Table

ClassProperties
visible visibility: visible;
invisiblevisibility: hidden;
collapsevisibility: collapse;

Windframe Tailwind blocks

blog

Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs

Start building stunning tailwind UIs! 

Build from scratch or select prebuilt tailwind templates