Visibility
Use to make an element visible. This is mostly useful for undoing the .invisible
utility at different screen sizes.
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).
To apply a visibility utility only at a specific breakpoint, add a 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 Tailwind’s responsive design features, check out the documentation.
all
sm
md
xl
By default, only responsive variants are generated for visibility utilities.
You can control which variants are generated for the visibility utilities by modifying the visibility
property in the section of your tailwind.config.js
file.
For example, this config will also generate hover and focus variants:
Disabling
If you don’t plan to use the visibility utilities in your project, you can disable them entirely by setting the visibility
property to false
in the section of your config file: