Dropdown Truncation Breadcrumb
A copy-paste breadcrumbs component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
BreadcrumbsHTMLCSSany framework
Copy into your project
HTML
<nav aria-label="Breadcrumb" class="nuda-bc2-dropdown">
<ol class="nuda-bc2-dropdown__list">
<li class="nuda-bc2-dropdown__item"><a class="nuda-bc2-dropdown__link" href="#">Home</a></li>
<li class="nuda-bc2-dropdown__sep" aria-hidden="true">/</li>
<li class="nuda-bc2-dropdown__item nuda-bc2-dropdown__item--trunc">
<button type="button" class="nuda-bc2-dropdown__trigger" aria-haspopup="true" aria-expanded="false">…</button>
<ul class="nuda-bc2-dropdown__menu">
<li><a class="nuda-bc2-dropdown__menulink" href="#">Library</a></li>
<li><a class="nuda-bc2-dropdown__menulink" href="#">2024</a></li>
</ul>
</li>
<li class="nuda-bc2-dropdown__sep" aria-hidden="true">/</li>
<li class="nuda-bc2-dropdown__item"><span class="nuda-bc2-dropdown__link nuda-bc2-dropdown__link--cur" aria-current="page">Report</span></li>
</ol>
</nav>CSS
.nuda-bc2-dropdown {
width: 260px;
font-size: .8rem;
}
.nuda-bc2-dropdown__list {
display: flex;
align-items: center;
gap: .3rem;
list-style: none;
margin: 0;
padding: 0;
}
.nuda-bc2-dropdown__item {
position: relative;
}
.nuda-bc2-dropdown__item--trunc {
display: flex;
align-items: center;
}
.nuda-bc2-dropdown__link {
color: #999;
text-decoration: none;
}
.nuda-bc2-dropdown__link:hover {
color: #e4ff54;
}
.nuda-bc2-dropdown__link--cur {
color: #fafafa;
font-weight: 600;
}
.nuda-bc2-dropdown__sep {
color: #444;
}
.nuda-bc2-dropdown__trigger {
min-width: 44px;
min-height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
color: #999;
font-size: 1rem;
cursor: pointer;
border-radius: 6px;
line-height: 1;
}
.nuda-bc2-dropdown__trigger:hover {
background: #1c1c1c;
color: #fafafa;
}
.nuda-bc2-dropdown__trigger:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-bc2-dropdown__menu {
position: absolute;
top: calc(100% + 4px);
left: 0;
min-width: 130px;
background: #161616;
border: 1px solid rgba(255,255,255,.1);
border-radius: 8px;
padding: .3rem;
margin: 0;
list-style: none;
box-shadow: 0 12px 28px rgba(0,0,0,.45);
opacity: 0;
pointer-events: none;
transform: translateY(-6px) scale(.96);
transform-origin: top left;
z-index: 5;
}
.nuda-bc2-dropdown__item--trunc:hover .nuda-bc2-dropdown__menu,.nuda-bc2-dropdown__item--trunc:focus-within .nuda-bc2-dropdown__menu {
opacity: 1;
pointer-events: auto;
animation: _nuda-bc2dropdownin .18s ease forwards;
}
.nuda-bc2-dropdown__menulink {
display: block;
padding: .35rem .5rem;
color: #ccc;
text-decoration: none;
border-radius: 5px;
font-size: .76rem;
}
.nuda-bc2-dropdown__menulink:hover {
background: #232323;
color: #e4ff54;
}
@keyframes _nuda-bc2dropdownin {
from {
opacity: 0;
transform: translateY(-6px) scale(.96);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-bc2-dropdown__item--trunc:hover .nuda-bc2-dropdown__menu,.nuda-bc2-dropdown__item--trunc:focus-within .nuda-bc2-dropdown__menu {
animation: none !important;
opacity: 1;
transform: none;
}
}
How to use Dropdown Truncation Breadcrumb
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.