Truncate
Cuts text after one line or a set number of lines with an ellipsis and shows the full text in a tooltip.
Paste this into your agent.
Truncate clips titles, file names and descriptions that can outgrow their box, such as card titles or table cells. Assistive technology still gets the whole text, and a tooltip shows it on hover.
Install
bashnpx shadcn@4.18.0 add @siteplane/truncate
Import it from @/siteplane/components/truncate. The project needs Siteplane UI's one-time setup first: .
When to pick it
- vs : Truncate already adds a tooltip with the full text; reach for Tooltip only for other labels.
- vs : Pick Scroll Area instead when people need the full content in place.
Rules
- Nest Truncate within the element whose text it clips, like a CardTitle or a table cell, so the outer element and its styling stay intact.
- Set lines for a multi-line clamp instead of a single line.
- In table cells and other containers that expand to fit their content, cap it with a width class like max-w-56.
- Keep error messages, instructions and legal copy whole; people need every word.
- Skip it for menu rows, Badge, Tag and Button labels, which already end in an ellipsis.
Reference
Add to your agent
Print this skill from the terminal, or connect the whole catalog over MCP. Setup guides
CLI
MCP server
Questions
Related skills
Compact Landingby Danilaa1
Build compact premium landing pages with clear CTA hierarchy, quiet typography, and minimal visual noise.
VisualExternalGitHub stars: 37
60fps Animationby iart-ai
Web animation performance guidance for avoiding layout thrashing and reaching smooth 60/120fps motion with compositor-friendly techniques.
MotionExternalGitHub stars: 64
Accessibilityby addyosmani
Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".
AccessibilityExternalGitHub stars: 3K
Accessibility Diffby AccessLint
Regression check that diffs a live page's accessibility violations against a baseline from uncommitted changes or a branch.
AccessibilityExternalGitHub stars: 114