Skip to content

Text Truncation

The text-truncate helper shortens long text to a single line and ends it with an ellipsis. It needs a block or inline-block element with a width limit; in flex layouts give the flexible item min-width: 0.

1Block level truncation

A block element with a max width; the dashed outline shows the limit.

Bread is baked every morning and pasta is rolled by hand in our kitchen. Cooking classes on Saturday mornings teach you our favourite recipes.

2Inline-block inside a sentence

Inline elements need d-inline-block plus a max width to truncate.

Last edited by Priya Rossi and Finn Brennan 39 min ago.

3Inbox preview

Subject and preview text cut to one line in an email list.

  • Lucas VargaThe small habits that make a big difference – We listen first, then build a plan around what you actually need. Clear prices, honest advice and no surprises along the way.
  • Mason LindqvistMeet the farmers behind our menu – Our team has done this many times, so you never have to guess. We keep things simple, so you can focus on what matters to you.
  • Maya NguyenOur favourite tips for busy weeks – We have been feeding this neighbourhood for over a decade, and we still love it. Friendly people answer your questions quickly, by phone, chat or email.

4Table cell notes

A long note column truncated with text-truncate and a max width on the cell.

OrderNoteTotal
#TX-9837Our terrace is open from spring to autumn, with heaters for cooler evenings.$182.45
#TX-9815Book a table online in seconds, or call us for groups of eight or more.$88.37
#TX-8171We measure success by how many guests come back and tell their friends.$189.25

5Long file names

File names shorten while the size stays visible at the end.

  • five-things-we-learned-this-year-final-version-4.docx283 KB
  • our-chocolate-tart,-step-by-step-final-version-7.docx436 KB
  • our-chef's-guide-to-seasonal-autumn-produce-final-version-7.docx459 KB

6Breadcrumb with a long last item

The current page title truncates so the breadcrumb stays on one line.

7Notification preview

A toast-like card where the message preview stays on one line.

Diego Larsen replied: Order for pickup or delivery and enjoy the same dishes at home.just now

8Equal card titles

Truncated titles keep a grid of cards the same height.

Five wines to pair with a summer dinner: Start in minutes and get help from a real person whenever you need it.

Dec 19, 2025

Planning the perfect birthday dinner: Vegan, vegetarian and gluten-free dishes are marked clearly on every menu.

Aug 7, 2026

The small habits that make a big difference: We have been feeding this neighbourhood for over a decade, and we still love it.

May 22, 2026

9Chat list

In a flex row the text column needs min-width: 0 so text-truncate can shrink it.

10Long web addresses

Page addresses truncate in a link list; the full address is kept in the title attribute.

11Product grid names

Product names cut to one line under each image in a compact grid.

Garden salad Starters edition
$12.00
Chocolate tart Desserts edition
$10.00
Lemon tiramisu Desserts edition
$11.00
Chef's tasting plate Specials edition
$41.99

12Truncated chips

Badges with a max width so long labels never break the row.

The story of our wood-fired ovenWhat our guests asked us mostA beginner's guide to getting startedThree pasta shapes to make at home

13User menu name

A long account name truncates inside the navbar button.

14Why min-width: 0 matters

Left: a flex child without min-width overflows. Right: with min-width: 0 the text truncates.

Without min-width

Our sommelier has paired each dish with wines from small family vineyards. Thousands of guests already trust us, and we work hard to keep it that way.
New

With min-width: 0

We listen first, then build a plan around what you actually need. Clear prices, honest advice and no surprises along the way.
New

15Sidebar menu

Project names in a narrow sidebar stay on one line each.

16Kanban card titles

Narrow board columns keep task titles tidy with truncation.

To do
How to choose the right dish
Our favourite tips for busy weeks
Doing
Vegan dishes worth crossing town for
Five things we learned this year
Done
What is new on our winter menu
Our chocolate tart, step by step

17Order summary address

A long shipping address truncated in a summary line, with an edit link.

Hana Ibrahim, 341 Maple Avenue, Copenhagen 89494, Denmark Change

18Dropdown with a long value

The selected option truncates inside a fixed width dropdown button.

19Playlist

Long episode or track titles truncate while the duration stays aligned.

  1. Good food brings people together5:04
  2. Seasonal menus from local farms5:21
  3. Where every dinner feels like a celebration2:02

20Full text in a tooltip

Offer the complete text in a tooltip so nothing is lost when it is truncated.

Cooking classes on Saturday mornings teach you our favourite recipes. Our terrace is open from spring to autumn, with heaters for cooler evenings.