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. 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
visiblevisibility: visible;
invisiblevisibility: hidden;
collapsevisibility: collapse;

Windframe Tailwind blocks

blog

Build modern projects using Bootstrap 5 and Contrast

Trying to create components and pages for a web app or website from scratch while maintaining a modern User interface can be very tedious. This is why we created Contrast, to help drastically reduce the amount of time we spend doing that. so we can focus on building some other aspects of the project.

Contrast Bootstrap PRO consists of a Premium UI Kit Library featuring over 10000+ component variants. Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.

ad-banner