Skip to content

Visibility ​

Utilities for controlling the visibility of an element in the DOM.

Class NameCSS Equivalent
visiblevisibility: visible;
invisiblevisibility: hidden;
collapsevisibility: collapse;

Visible ​

The .visible class sets the visibility property to visible. This is the default visibility for an element in the normal flow of the document.

html
<div class="visible">
  <!-- Element with visible position -->
</div>

Invisible ​

The .invisible class sets the visibility property to hidden. It allows you to make an element invisible in the normal flow of the document, but the element still takes up space.

html
<div class="invisible">
  <!-- Element with invisible position -->
</div>
1
3
4

Collapse ​

Use collapse 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.

html
<tr class="collapse">
  <!-- Element with collapsed position -->
</tr>
Showing all rows
First nameLast nameRole
AliceJohnsonCEO
BobSmithTechnical Advisor
CharlieBrownCTO
DianaMillerCFO
Hiding row 2 with collapse
First nameLast nameRole
AliceJohnsonCEO
BobSmithTechnical Advisor
CharlieBrownCTO
DianaMillerCFO
Hiding row 2 with hidden
First nameLast nameRole
AliceJohnsonCEO
CharlieBrownCTO
DianaMillerCFO