Skip to content

Helpers

Miscellaneous utilities for visibility, accessibility, interaction, and content display.

Visibility

ClassPropertyValue
visiblevisibilityvisible
invisiblevisibilityhidden

Unlike d-none, invisible hides the element but keeps its space in the document flow.

Accessibility

ClassEffect
sr-onlyVisually hidden but readable by screen readers (absolute position, 1px clipped size)

Pointer events

Classpointer-events
pointer-events-nonenone
pointer-events-autoauto

User select

Classuser-select
select-nonenone
select-texttext
select-allall
select-autoauto

Object fit

Classobject-fit
object-containcontain
object-covercover
object-fillfill
object-nonenone

Aspect ratio

Classaspect-ratio
aspect-square1 / 1
aspect-video16 / 9
aspect-autoauto

Line clamp

ClassEffect
line-clamp-1Clamp to 1 line with
line-clamp-2Clamp to 2 lines
line-clamp-3Clamp to 3 lines
line-clamp-4Clamp to 4 lines
line-clamp-5Clamp to 5 lines

Examples

html
<!-- Screen-reader only label -->
<button>
  <span aria-hidden="true">X</span>
  <span class="sr-only">Close dialog</span>
</button>

<!-- Non-clickable decorative overlay -->
<div class="pointer-events-none absolute inset-0">
  Decorative layer
</div>

<!-- Responsive video thumbnail -->
<div class="aspect-video overflow-hidden radius-8">
  <img class="w-100 h-100 object-cover" src="thumbnail.jpg" />
</div>

<!-- Square icon box -->
<div class="aspect-square d-flex items-center justify-center bg-blue radius-4" style="width: 48px">
  <i class="icon text-white"></i>
</div>

<!-- Truncated description -->
<p class="line-clamp-2">
  A very long product description that will be clamped after the second line...
</p>

<!-- Prevent text selection -->
<div class="select-none">This text cannot be selected</div>