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

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

Visibility - 图3

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.

Visibility - 图5

sm

md

Visibility - 图7

lg

Visibility - 图9

By default, only responsive variants are generated for visibility utilities.

You can control which variants are generated for the visibility utilities by modifying the property in the modules section of your Tailwind config 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 in the modules section of your config file:

Visibility - 图11