Sticky Day Groups
A copy-paste notification center component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Notification CenterHTMLCSSany framework
- Today
- Build #291 succeeded — Unread
- Invitation accepted
- Weekly digest ready
- Yesterday
- 3 new comments on #design
- Storage 80% full
Copy into your project
HTML
<div class="nuda-nc2-day-sticky" role="region" aria-label="Notifications grouped by day">
<ul class="nuda-nc2-day-sticky__list">
<li class="nuda-nc2-day-sticky__head">Today</li>
<li class="nuda-nc2-day-sticky__row is-unread">
Build #291 succeeded
<span class="nuda-nc2-day-sticky__sr"> — Unread</span>
</li>
<li class="nuda-nc2-day-sticky__row">Invitation accepted</li>
<li class="nuda-nc2-day-sticky__row">Weekly digest ready</li>
<li class="nuda-nc2-day-sticky__head">Yesterday</li>
<li class="nuda-nc2-day-sticky__row">3 new comments on #design</li>
<li class="nuda-nc2-day-sticky__row">Storage 80% full</li>
</ul>
</div>CSS
.nuda-nc2-day-sticky {
width: 100%;
max-width: 260px;
background: rgba(255,255,255,.02);
border: 1px solid rgba(255,255,255,.06);
border-radius: 12px;
padding: 4px 6px;
}
.nuda-nc2-day-sticky__list {
list-style: none;
margin: 0;
padding: 0;
max-height: 190px;
overflow-y: auto;
}
.nuda-nc2-day-sticky__head {
position: sticky;
top: 0;
z-index: 1;
padding: 8px 8px 5px;
background: #131316;
color: #63636e;
font-size: 9px;
font-weight: 700;
letter-spacing: .12em;
text-transform: uppercase;
font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
border-bottom: 1px solid rgba(255,255,255,.06);
}
.nuda-nc2-day-sticky__row {
position: relative;
padding: 8px 10px 8px 20px;
color: #a0a0a8;
font-size: 12px;
border-radius: 6px;
cursor: pointer;
animation: _nuda-nc2day-sticky-in .35s cubic-bezier(.16,1,.3,1) both;
transition: background .2s,color .2s;
}
.nuda-nc2-day-sticky__row:hover {
background: rgba(255,255,255,.04);
color: #fafafa;
}
.nuda-nc2-day-sticky__row.is-unread {
color: #fafafa;
}
.nuda-nc2-day-sticky__row.is-unread::before {
content: "";
position: absolute;
left: 8px;
top: 50%;
transform: translateY(-50%);
width: 5px;
height: 5px;
border-radius: 50%;
background: #e4ff54;
}
.nuda-nc2-day-sticky__sr {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
white-space: nowrap;
border: 0;
}
@keyframes _nuda-nc2day-sticky-in {
from {
opacity: 0;
transform: translateX(-4px);
}
to {
opacity: 1;
transform: none;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-nc2-day-sticky__row {
animation: none;
}
}
How to use Sticky Day Groups
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.