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.
Thousands of students already trust us, and we work hard to keep it that way. Every detail is handled by people who care about getting it right.
<p class="text-truncate hp-tt mb-0" style="max-width:18rem">Thousands of students already trust us, and we work hard to keep it that way. Every detail is handled by people who care about getting it right.</p>2Inline-block inside a sentence
Inline elements need d-inline-block plus a max width to truncate.
Last edited by Luna Lindqvist and Mia Larsen just now.
<p class="mb-0">Last edited by <span class="d-inline-block text-truncate align-bottom hp-tt" style="max-width:8rem">Luna Lindqvist and Mia Larsen</span> just now.</p>3Inbox preview
Subject and preview text cut to one line in an email list.
- Jonah MensahWhat employers look for in junior analysts – Start in minutes and get help from a real person whenever you need it. Friendly people answer your questions quickly, by phone, chat or email.
- Diego AlvarezOur most popular courses this year – Try the first lesson of any course for free before you decide. Our team has done this many times, so you never have to guess.
- Samir DuarteA beginner's guide to getting started – Lifetime access means you can revisit lessons whenever you need a refresher. Earn a certificate at the end of each course and share it with employers.
<ul class="list-group">
<li class="list-group-item d-flex gap-3"><strong class="flex-shrink-0 small" style="width:7rem">Jonah Mensah</strong><span class="text-truncate small"><span class="fw-semibold">What employers look for in junior analysts</span> – Start in minutes and get help from a real person whenever you need it. Friendly people answer your questions quickly, by phone, chat or email.</span></li>
<li class="list-group-item d-flex gap-3"><strong class="flex-shrink-0 small" style="width:7rem">Diego Alvarez</strong><span class="text-truncate small"><span class="fw-semibold">Our most popular courses this year</span> – Try the first lesson of any course for free before you decide. Our team has done this many times, so you never have to guess.</span></li>
<li class="list-group-item d-flex gap-3"><strong class="flex-shrink-0 small" style="width:7rem">Samir Duarte</strong><span class="text-truncate small"><span class="fw-semibold">A beginner's guide to getting started</span> – Lifetime access means you can revisit lessons whenever you need a refresher. Earn a certificate at the end of each course and share it with employers.</span></li>
</ul>4Table cell notes
A long note column truncated with text-truncate and a max width on the cell.
| Order | Note | Total |
|---|---|---|
| #ORD-5006 | Study groups and a friendly forum keep you motivated along the way. | $221.14 |
| #ORD-6593 | Short quizzes after each lesson help new knowledge stick. | $282.85 |
| #ORD-4574 | Every course is built around hands-on projects you can add to your portfolio. | $220.85 |
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th scope="col">Order</th>
<th scope="col">Note</th>
<th scope="col" class="text-end">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>#ORD-5006</td>
<td class="text-truncate" style="max-width:12rem">Study groups and a friendly forum keep you motivated along the way.</td>
<td class="text-end">$221.14</td>
</tr>
<tr>
<td>#ORD-6593</td>
<td class="text-truncate" style="max-width:12rem">Short quizzes after each lesson help new knowledge stick.</td>
<td class="text-end">$282.85</td>
</tr>
<tr>
<td>#ORD-4574</td>
<td class="text-truncate" style="max-width:12rem">Every course is built around hands-on projects you can add to your portfolio.</td>
<td class="text-end">$220.85</td>
</tr>
</tbody>
</table>
</div>5Long file names
File names shorten while the size stays visible at the end.
- looking-back-at-a-busy-season-final-version-8.docx341 KB
- how-to-choose-the-right-course-final-version-2.docx422 KB
- what-our-students-asked-us-most-final-version-9.docx828 KB
<ul class="list-unstyled vstack gap-2 mb-0" style="max-width:20rem">
<li class="d-flex align-items-center gap-2"><span class="text-primary"><i class="bi bi-file-earmark-text" aria-hidden="true"></i></span><span class="text-truncate">looking-back-at-a-busy-season-final-version-8.docx</span><small class="ms-auto text-body-secondary flex-shrink-0">341 KB</small></li>
<li class="d-flex align-items-center gap-2"><span class="text-primary"><i class="bi bi-file-earmark-text" aria-hidden="true"></i></span><span class="text-truncate">how-to-choose-the-right-course-final-version-2.docx</span><small class="ms-auto text-body-secondary flex-shrink-0">422 KB</small></li>
<li class="d-flex align-items-center gap-2"><span class="text-primary"><i class="bi bi-file-earmark-text" aria-hidden="true"></i></span><span class="text-truncate">what-our-students-asked-us-most-final-version-9.docx</span><small class="ms-auto text-body-secondary flex-shrink-0">828 KB</small></li>
</ul>6Breadcrumb with a long last item
The current page title truncates so the breadcrumb stays on one line.
<nav aria-label="breadcrumb">
<ol class="breadcrumb flex-nowrap mb-0">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Lifestyle</a></li>
<li class="breadcrumb-item active text-truncate" aria-current="page">Guided learning paths take you from beginner to job-ready step by step.</li>
</ol>
</nav>7Notification preview
A toast-like card where the message preview stays on one line.
<div class="d-flex align-items-center gap-3 border rounded p-2" style="max-width:24rem">
<span class="fs-4 text-primary"><i class="bi bi-bell-fill" aria-hidden="true"></i></span>
<div class="text-truncate">
<strong class="small d-block text-truncate">Priya Whitaker replied: The mobile app downloads lessons, so you can learn on the train.</strong><small class="text-body-secondary">41 min ago</small>
</div>
</div>8Equal card titles
Truncated titles keep a grid of cards the same height.
How to choose the right course: We measure success by how many students come back and tell their friends.
Jan 1, 2026
How we build a course, start to finish: Guided learning paths take you from beginner to job-ready step by step.
May 29, 2026
Five things we learned this year: Short quizzes after each lesson help new knowledge stick.
Dec 24, 2025
<div class="row g-3">
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h3 class="h6 text-truncate">How to choose the right course: We measure success by how many students come back and tell their friends.</h3>
<p class="small text-body-secondary mb-0">Jan 1, 2026</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h3 class="h6 text-truncate">How we build a course, start to finish: Guided learning paths take you from beginner to job-ready step by step.</h3>
<p class="small text-body-secondary mb-0">May 29, 2026</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h3 class="h6 text-truncate">Five things we learned this year: Short quizzes after each lesson help new knowledge stick.</h3>
<p class="small text-body-secondary mb-0">Dec 24, 2025</p>
</div>
</div>
</div>
</div>9Chat list
In a flex row the text column needs min-width: 0 so text-truncate can shrink it.
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action d-flex gap-2 align-items-center"><img src="../assets/img/avatar-5.svg" alt="" width="40" height="40" class="rounded-circle">
<div style="min-width:0" class="flex-grow-1">
<div class="d-flex">
<strong class="small text-truncate">Ivy Silva</strong><small class="ms-auto ps-2 text-body-secondary">20:15</small>
</div>
<div class="small text-body-secondary text-truncate">
Clear prices, honest advice and no surprises along the way. Every course is built around hands-on projects you can add to your portfolio.
</div>
</div>
</a><a href="#" class="list-group-item list-group-item-action d-flex gap-2 align-items-center"><img src="../assets/img/avatar-1.svg" alt="" width="40" height="40" class="rounded-circle">
<div style="min-width:0" class="flex-grow-1">
<div class="d-flex">
<strong class="small text-truncate">Arjun Morgan</strong><small class="ms-auto ps-2 text-body-secondary">08:15</small>
</div>
<div class="small text-body-secondary text-truncate">
Thousands of students already trust us, and we work hard to keep it that way. Lifetime access means you can revisit lessons whenever you need a refresher.
</div>
</div>
</a><a href="#" class="list-group-item list-group-item-action d-flex gap-2 align-items-center"><img src="../assets/img/avatar-6.svg" alt="" width="40" height="40" class="rounded-circle">
<div style="min-width:0" class="flex-grow-1">
<div class="d-flex">
<strong class="small text-truncate">Sofia Kim</strong><small class="ms-auto ps-2 text-body-secondary">10:00</small>
</div>
<div class="small text-body-secondary text-truncate">
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.
</div>
</div>
</a>
</div>10Long web addresses
Page addresses truncate in a link list; the full address is kept in the title attribute.
<ul class="list-unstyled vstack gap-1 mb-0" style="max-width:20rem">
<li><a href="#" class="d-block text-truncate" title="example.com/routine/how-to/getting-started-with-the-new-dashboard">example.com/routine/tutorial/getting-started-with-the-new-dashboard</a></li>
<li><a href="#" class="d-block text-truncate" title="example.com/help/articles/how-to-reset-your-password-and-security-keys">example.com/help/articles/how-to-reset-your-password-and-security-keys</a></li>
</ul>11Product grid names
Product names cut to one line under each image in a compact grid.
<div class="row g-2">
<div class="col-6 col-md-3">
<div class="border rounded p-2">
<img src="../assets/img/product-7.svg" alt="" class="img-fluid rounded mb-1">
<div class="small text-truncate">
Digital marketing Marketing edition
</div>
<strong class="small">$120.99</strong>
</div>
</div>
<div class="col-6 col-md-3">
<div class="border rounded p-2">
<img src="../assets/img/product-2.svg" alt="" class="img-fluid rounded mb-1">
<div class="small text-truncate">
Data analysis Development edition
</div>
<strong class="small">$197.00</strong>
</div>
</div>
<div class="col-6 col-md-3">
<div class="border rounded p-2">
<img src="../assets/img/product-12.svg" alt="" class="img-fluid rounded mb-1">
<div class="small text-truncate">
Video editing Design edition
</div>
<strong class="small">$106.00</strong>
</div>
</div>
<div class="col-6 col-md-3">
<div class="border rounded p-2">
<img src="../assets/img/product-8.svg" alt="" class="img-fluid rounded mb-1">
<div class="small text-truncate">
Brand design Design edition
</div>
<strong class="small">$136.00</strong>
</div>
</div>
</div>12Truncated chips
Badges with a max width so long labels never break the row.
<div class="d-flex flex-wrap gap-2">
<span class="badge rounded-pill text-bg-light border d-inline-block text-truncate" style="max-width:9rem">How to learn a new skill in 30 days</span><span class="badge rounded-pill text-bg-light border d-inline-block text-truncate" style="max-width:9rem">Building a portfolio that gets interviews</span><span class="badge rounded-pill text-bg-light border d-inline-block text-truncate" style="max-width:9rem">Looking back at a busy season</span><span class="badge rounded-pill text-bg-light border d-inline-block text-truncate" style="max-width:9rem">What employers look for in junior analysts</span>
</div>13User menu name
A long account name truncates inside the navbar button.
<nav class="navbar bg-body-tertiary rounded px-3">
<span class="navbar-brand mb-0 h6">Rallyix Labs</span>
<button type="button" class="btn btn-light btn-sm d-flex align-items-center gap-2" style="max-width:12rem"> <img src="../assets/img/avatar-12.svg" alt="" width="24" height="24" class="rounded-circle"><span class="text-truncate">Nadia Okafor (Art Director)</span><i class="bi bi-chevron-down" aria-hidden="true"></i> </button>
</nav>14Why min-width: 0 matters
Left: a flex child without min-width overflows. Right: with min-width: 0 the text truncates.
Without min-width
With min-width: 0
<div class="row g-3">
<div class="col-sm-6">
<p class="small fw-semibold mb-1">Without min-width</p>
<div class="d-flex border rounded p-2 overflow-hidden">
<div class="flex-grow-1">
<div class="text-truncate">
Friendly people answer your questions quickly, by phone, chat or email. Study groups and a friendly forum keep you motivated along the way.
</div>
</div>
<span class="badge text-bg-secondary ms-2">New</span>
</div>
</div>
<div class="col-sm-6">
<p class="small fw-semibold mb-1">With min-width: 0</p>
<div class="d-flex border rounded p-2">
<div class="flex-grow-1" style="min-width:0">
<div class="text-truncate">
Instructors are working professionals who teach what they use every day. The mobile app downloads lessons, so you can learn on the train.
</div>
</div>
<span class="badge text-bg-primary ms-2">New</span>
</div>
</div>
</div>15Sidebar menu
Project names in a narrow sidebar stay on one line each.
<nav class="border rounded p-2" style="max-width:14rem" aria-label="Projects">
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link d-flex gap-2 py-1 px-2" href="#"><i class="bi bi-folder" aria-hidden="true"></i><span class="text-truncate">Certificates Friendly update elegant</span></a></li>
<li class="nav-item"><a class="nav-link d-flex gap-2 py-1 px-2" href="#"><i class="bi bi-folder" aria-hidden="true"></i><span class="text-truncate">Live workshops Bright idea secure</span></a></li>
<li class="nav-item"><a class="nav-link d-flex gap-2 py-1 px-2" href="#"><i class="bi bi-folder" aria-hidden="true"></i><span class="text-truncate">Certificates Flexible process calm</span></a></li>
<li class="nav-item"><a class="nav-link d-flex gap-2 py-1 px-2" href="#"><i class="bi bi-folder" aria-hidden="true"></i><span class="text-truncate">Career coaching Calm community focused</span></a></li>
</ul>
</nav>16Kanban card titles
Narrow board columns keep task titles tidy with truncation.
<div class="row g-2">
<div class="col-4">
<div class="bg-body-tertiary rounded p-2">
<small class="fw-semibold">To do</small>
<div class="bg-body border rounded p-2 mt-2 small text-truncate">
From teacher to UX designer: a career story
</div>
<div class="bg-body border rounded p-2 mt-2 small text-truncate">
What our students asked us most
</div>
</div>
</div>
<div class="col-4">
<div class="bg-body-tertiary rounded p-2">
<small class="fw-semibold">Doing</small>
<div class="bg-body border rounded p-2 mt-2 small text-truncate">
A beginner's guide to getting started
</div>
<div class="bg-body border rounded p-2 mt-2 small text-truncate">
How to stay motivated when learning online
</div>
</div>
</div>
<div class="col-4">
<div class="bg-body-tertiary rounded p-2">
<small class="fw-semibold">Done</small>
<div class="bg-body border rounded p-2 mt-2 small text-truncate">
Our most popular courses this year
</div>
<div class="bg-body border rounded p-2 mt-2 small text-truncate">
Our favourite tips for busy weeks
</div>
</div>
</div>
</div>17Order summary address
A long shipping address truncated in a summary line, with an edit link.
<div class="d-flex align-items-center gap-2 border rounded p-2">
<span class="text-body-secondary"><i class="bi bi-truck" aria-hidden="true"></i></span> <span class="text-truncate small">Hana Nguyen, 365 Harbour Road, Copenhagen 29165, Denmark</span> <a href="#" class="ms-auto small flex-shrink-0">Change</a>
</div>18Dropdown with a long value
The selected option truncates inside a fixed width dropdown button.
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle d-inline-flex align-items-center" type="button" id="hp-dd-1242" data-ui-toggle="dropdown" aria-expanded="false" style="max-width:14rem"> <span class="text-truncate">Certificates for students</span> </button>
<ul class="dropdown-menu" aria-labelledby="hp-dd-1242">
<li><a class="dropdown-item" href="#">Live workshops</a></li>
<li><a class="dropdown-item" href="#">Study groups</a></li>
</ul>
</div>19Playlist
Long episode or track titles truncate while the duration stays aligned.
- Learn by doing, not just watching5:55
- The online school for busy people2:05
- Skills employers are looking for5:25
<ol class="list-group list-group-numbered">
<li class="list-group-item d-flex gap-2"><span class="text-truncate">Learn by doing, not just watching</span><small class="ms-auto text-body-secondary">5:55</small></li>
<li class="list-group-item d-flex gap-2"><span class="text-truncate">The online school for busy people</span><small class="ms-auto text-body-secondary">2:05</small></li>
<li class="list-group-item d-flex gap-2"><span class="text-truncate">Skills employers are looking for</span><small class="ms-auto text-body-secondary">5:25</small></li>
</ol>20Full text in a tooltip
Offer the complete text in a tooltip so nothing is lost when it is truncated.
<span class="d-inline-block text-truncate hp-tt" style="max-width:16rem" tabindex="0" data-ui-toggle="tooltip" data-ui-title="Career coaches help with your CV, portfolio and interview practice. Learn on your schedule, with lessons that fit into a lunch break.">Career coaches help with your CV, portfolio and interview practice. Learn on your schedule, with lessons that fit into a lunch break.</span>