Visibility
Controls the visibility of an element without affecting the layout.
Widely available
This feature is well established and works across many devices and browser versions.
| Class | Style |
|---|---|
v-c | visibility: collapse; |
v-h | visibility: hidden; |
v-v | visibility: visible; |
Visible
Initial value
The element will be displayed and take up space in the layout.
<div class="d-g g-4 gtc-1 sm:gtc-3"> <div class="ai-c bg-indigo d-f jc-c d-16 tc-white v-v">A</div> <div class="ai-c bg-indigo d-f jc-c d-16 tc-white">B</div> <div class="ai-c bg-indigo d-f jc-c d-16 tc-white">C</div></div>Collapse
The element will be hidden, and it will not take up any space in the layout.
| H1 | H2 |
|---|---|
| A | B |
| C | D |
| E | F |
<table class="b-1 b-d bc-c tc-slate w-full"> <thead> <tr> <th class="b-1 b-d bg-silver-2 bc-slate p-3 ta-c">H1</th> <th class="b-1 b-d bg-silver-2 bc-slate p-3 ta-c">H2</th> </tr> </thead> <tbody> <tr> <td class="b-1 b-d bc-slate p-3 ta-c">A</td> <td class="b-1 b-d bc-slate p-3 ta-c">B</td> </tr> <tr class="v-c"> <td class="b-1 b-d bc-slate p-3 ta-c">C</td> <td class="b-1 b-d bc-slate p-3 ta-c">D</td> </tr> <tr> <td class="b-1 b-d bc-slate p-3 ta-c">E</td> <td class="b-1 b-d bc-slate p-3 ta-c">F</td> </tr> </tbody></table>Hidden
The element will be hidden, but it will still take up space in the layout.
<div class="d-g g-4 gtc-1 sm:gtc-3"> <div class="ai-c bg-indigo d-f jc-c d-16 tc-white v-h">A</div> <div class="ai-c bg-indigo d-f jc-c d-16 tc-white">B</div> <div class="ai-c bg-indigo d-f jc-c d-16 tc-white">C</div></div>Using utility variants
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
Targeting different viewports
You can combine responsive breakpoints like sm:v-*, md:v-*, lg:v-*, and xxl:v-* to allow targeting specific utilities in different viewports.
Targeting hover states
Alternatively, you can apply :hover by using h:v-* utility to override elements and change their values when hovering over them.