--- id: slds.guidance.utilities.line-clamp title: Line-clamp Utilities description: SLDS line-clamp utility classes for multi-line text truncation summary: "Utilities for multi-line text truncation (2-7 lines). Provides controlled text overflow with ellipsis for readable content length management." artifact_type: reference domain: utilities topic: line-clamp content_format: structured complexity: intermediate audience: [implementer] tasks: [implement] refs: - slds.guidance.utilities - slds.guidance.overview.utilities - slds.guidance.utilities.truncate tags: [utilities, line-clamp, truncation, text] keywords: [slds-line-clamp, text-truncation, ellipsis, multi-line] --- # Line Clamp - Multi-line Text Truncation Controlled multi-line text truncation with ellipsis. ## Line Limit Scale | Class | Lines | Use Case | |-------|-------|----------| | `slds-line-clamp` | 3 lines | Default truncation for card descriptions | | `slds-line-clamp_x-small` | 2 lines | Compact list items and previews | | `slds-line-clamp_small` | 3 lines | Standard card and tile descriptions | | `slds-line-clamp_medium` | 5 lines | Extended previews and summaries | | `slds-line-clamp_large` | 7 lines | Long-form content with controlled height | ## Common Patterns ### Card Description Truncation ```html
This is a long description that will be truncated after three lines of text. Any content beyond the third line will be hidden with an ellipsis to indicate more content is available.
Brief product description limited to two lines
More detailed product information that can extend up to five lines before being truncated
`, `