Skip to content
v0.9.1
Helpers

Truncated text

Cut long text short and still let people read all of it. .truncate keeps one line, .line-clamp-2 (to 6) keeps a few. When the text really is cut off, pointing at it (or tabbing to it) shows the full text in a tooltip. Text that fits gets no tooltip.

Examples

Quarterly planning notes for the website redesign and the new pricing page

Short title

Quarterly planning notes for the website redesign, the new pricing page, the onboarding emails and the help center rewrite.

<div class="stack max-w-xs">
  <p class="truncate box p-2 m-0">Quarterly planning notes for the website redesign and the new pricing page</p>
  <p class="truncate box p-2 m-0">Short title</p>
  <div class="box p-2"><p class="line-clamp-2 m-0">Quarterly planning notes for the website redesign, the new pricing page, the onboarding emails and the help center rewrite.</p></div>
</div>

Point at the first and the last: their full text appears. The second one fits, so it shows nothing.

Give a clamped block no padding of its own: the cut-off line would peek into the bottom padding. Put the padding on a wrapper instead, as the last one does.

In tables and lists

Brand guidelines - final version for the partners (Nov 2026).pdf2.4 MB
Invoice 1042.pdf98 KB
<div class="box p-0 max-w-sm">
  <div class="hstack px-4 py-3 border-b"><i class="mi mi-file-text text-muted" aria-hidden="true"></i><span class="truncate flex-1">Brand guidelines - final version for the partners (Nov 2026).pdf</span><span class="text-sm text-muted">2.4 MB</span></div>
  <div class="hstack px-4 py-3"><i class="mi mi-file-text text-muted" aria-hidden="true"></i><span class="truncate flex-1">Invoice 1042.pdf</span><span class="text-sm text-muted">98 KB</span></div>
</div>

In a row, give the text flex-1 (or min-w-0) so it can shrink and cut.

Good to know

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close