Visibility

Utilities for controlling the visibility of an element


Class reference

ClassProperties
visiblevisibility: visible;
invisiblevisibility: hidden;

Visible

Use .visible to make an element visible. This is mostly useful for undoing the .invisible utility at different screen sizes.

1
3
<div class="flex justify-center space-x-4">
<div>1</div>
<div class="invisible ...">2</div>
<div>3</div>
</div>

Invisible

Use .invisible to hide an element, but still maintain its place in the DOM, affecting the layout of other elements (compare with .hidden from the display documentation).

1
2
3
<div class="flex justify-center space-x-4">
<div>1</div>
<div class="visible ...">2</div>
<div>3</div>
</div>

Responsive

To apply a visibility utility only at a specific breakpoint, add a {screen}: prefix to the existing class name. For example, adding the class md:invisible to an element would apply the invisible utility at medium screen sizes and above.

For more information about Elements’ responsive design features, check out the Responsive Design documentation.