Class reference

Visibility - 图1

Visible Default

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

Visibility - 图2

Invisible

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

Visibility - 图3

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.

Visibility - 图4

all

Visibility - 图5

sm

Visibility - 图6

md

Visibility - 图7

lg

Visibility - 图8

xl

Visibility - 图9

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:

Visibility - 图10

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:

Visibility - 图11