Skip to content

Text wrapping & clamp

Utilities for controlling wrapping, breaking long strings, and line clamping.

ClassStyles
af-text-nowrapwhite-space: nowrap
af-text-breakoverflow-wrap: anywhere; word-break: break-word
af-clamp / af-clamp-11-line clamp
af-clamp-2 / af-clamp-3 / af-clamp-4multi-line clamp
  • af-text-nowrap
  • af-text-break
  • af-clamp / af-clamp-1 (equivalent - clamp to 1 line)
  • af-clamp-2 / af-clamp-3 / af-clamp-4
Clamp to 2 lines

A long paragraph that will be clamped to two lines. Add enough text and you’ll see it truncate after the second line.

<p class="af-clamp-2 af-p-sm" style="max-width: 20rem;">
  A long paragraph that will be clamped to two lines. Add enough text and you'll see it truncate after the second line.
</p>

All wrapping utilities support responsive variants using the @{bp} suffix. See Responsive Suffix for syntax and breakpoints.