Skip to content
Iris Hub

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.

We measure success by how many guests come back and tell their friends. Our sommelier has paired each dish with wines from small family vineyards.

2Inline-block inside a sentence

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

Last edited by Kai Ibrahim and Arjun Mensah just now.

3Inbox preview

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

  • Amara NguyenOur favourite tips for busy weeks – Order for pickup or delivery and enjoy the same dishes at home. Clear prices, honest advice and no surprises along the way.
  • Hana QuinnHow we make our sourdough every morning – Cooking classes on Saturday mornings teach you our favourite recipes. Friendly people answer your questions quickly, by phone, chat or email.
  • Ruby NovakFive wines to pair with a summer dinner – Private dining rooms seat up to forty guests for birthdays and business dinners. Our team has done this many times, so you never have to guess.

4Table cell notes

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

OrderNoteTotal
#PO-5424Book a table online in seconds, or call us for groups of eight or more.$51.60
#TX-9373Every dish is cooked to order, so tell us if you would like anything changed.$324.04
#INV-3261Children are always welcome, with a menu made just for them.$354.38

5Long file names

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

  • what-our-guests-asked-us-most-final-version-4.docx753 KB
  • the-small-habits-that-make-a-big-difference-final-version-8.docx730 KB
  • meet-the-farmers-behind-our-menu-final-version-2.docx518 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.

Jonah Ortega replied: Order for pickup or delivery and enjoy the same dishes at home.4 days ago

8Equal card titles

Truncated titles keep a grid of cards the same height.

Planning the perfect birthday dinner: Private dining rooms seat up to forty guests for birthdays and business dinners.

Aug 23, 2026

Five things we learned this year: Vegan, vegetarian and gluten-free dishes are marked clearly on every menu.

Jul 4, 2026

The story of our wood-fired oven: Bread is baked every morning and pasta is rolled by hand in our kitchen.

Sep 27, 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.

Lemon tiramisu Desserts edition
$11.00
House lemonade Drinks edition
$5.00
Burrata with tomatoes Starters edition
$15.00
Slow-cooked lamb Specials edition
$32.00

12Truncated chips

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

Our favourite tips for busy weeksOur chef's guide to seasonal autumn produceA beginner's guide to getting startedThe small habits that make a big difference

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

Cooking classes on Saturday mornings teach you our favourite recipes. Clear prices, honest advice and no surprises along the way.
New

With min-width: 0

Our menu changes with the seasons and the best produce from nearby farms. Friendly people answer your questions quickly, by phone, chat or email.
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
Vegan dishes worth crossing town for
Our chocolate tart, step by step
Doing
What our guests asked us most
Meet the farmers behind our menu
Done
Five wines to pair with a summer dinner
How we make our sourdough every morning

17Order summary address

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

Omar Haddad, 55 Harbour Road, Montreal 62156, Canada 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. Come hungry, leave happy5:27
  2. A table for every occasion2:51
  3. Taste the city's favourite kitchen5:46

20Full text in a tooltip

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

We keep things simple, so you can focus on what matters to you. Start in minutes and get help from a real person whenever you need it.