Utilities for controlling the visibility of an element.
| Class | Styles |
|---|---|
visible |
visibility: visible; |
invisible |
visibility: hidden; |
collapse |
visibility: collapse; |
Use the invisible utility to hide an element, but still maintain its place in the document, affecting the layout of other elements:
To completely remove an element from the document, use the display property instead.
Use the collapse utility to hide table rows, row groups, columns, and column groups as if they were set to display: none, but without impacting the size of other rows and columns:
This makes it possible to dynamically toggle rows and columns without affecting the table layout.
Use the visible utility to make an element visible:
This is mostly useful for undoing the invisible utility at different screen sizes.
Prefix a visibility utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<div class="visible md:invisible ..."> <!-- ... --> </div>
Learn more about using variants in the variants documentation.
© Tailwind Labs Inc.
https://tailwindcss.com/docs/visibility