Visibility

Utilities for controlling the visibility of an element.

Class reference

Class Properties
.visible visibility: visible;
.invisible visibility: hidden;

Visible Default

Use .visible to make an element visible. This will typically be used as a reset when using the .invisible utility.

<div class="visible bg-grey-light w-24 h-24 rounded-full"></div>

Invisible

Use .invisible to hide an element, but still maintain its space.

<div class="invisible bg-grey-light w-24 h-24 rounded-full"></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 Tailwind's responsive design features, check out the Responsive Design documentation.

Customizing

Responsive and State Variants

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 modules section of your Tailwind config file.

For example, this config will also generate hover and focus variants:

{
// ...
modules: {
    // ...
-   visibility: ['responsive'],
+   visibility: ['responsive', 'hover', 'focus', 'active', 'group-hover'],
}
}

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 modules section of your config file:

{
// ...
modules: {
    // ...
-   visibility: ['responsive'],
+   visibility: false,
}
}