Status Badges with Live Dot
People with online, busy, away and offline badges whose colour is backed by text, with a pulsing live dot.
AI prompt
Clean UI mockup of a team list with four rows, each with a round avatar with initials and a small status dot at the bottom right with a white ring, and a text badge beside the name: green Online with a soft pulse ring, red Busy, amber Away, grey Offline, a fifth row with a red Error badge and an exclamation icon, light theme, flat modern style. Negative: heavy shadows, gradients, clutter, text errors. Reduced motion: static design.About this pattern
Definition
A status badge shows state at a glance. The dot colour helps, but the word is what makes it accessible, since many people cannot tell green from red. A gentle pulse on a live or recording state draws attention without shouting, as long as it can be turned off.
Purpose & UX principles
- Pair every colour with a text label or an icon shape.
- Keep the set small: online, busy, away, offline, and an error state.
- Pulse only states that are active, using a slow expanding ring, about 2 seconds.
- Put a ring of the background colour around the dot on an avatar so it stands out.
Interaction states
- A list of four people; toggle the pulse and rotate a person's status.
Motion specification
- The ring pulses every 2 seconds.
- Reduced motion: no pulse.
Responsive behaviour
- Respect reduced motion by showing a static dot.
- Make the status available to screen readers as text, not only visually.
Code
<div class="bx"><ul class="ls" id="ls"></ul><div class="two"><label class="sw"><input id="pu" type="checkbox" checked> Pulse live status</label><button class="mini" id="cy" type="button">Change Maya’s status</button></div><p class="out" id="out" role="status"></p></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ls{list-style:none;display:grid;gap:6px}.ls li{display:flex;align-items:center;gap:10px;padding:6px 8px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:13px}.av{position:relative;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font:700 11px system-ui;color:#fff;flex:none}.av i{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;border:2px solid #fff;background:var(--c)}.pu .on i::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--c);animation:pl 2s ease-out infinite}@keyframes pl{from{transform:scale(.6);opacity:.8}to{transform:scale(1.6);opacity:0}}.nm{flex:1}.bd{font-size:11px;font-weight:700;padding:2px 8px;border-radius:99px;background:var(--bg2);color:var(--c2);display:inline-flex;gap:4px;align-items:center}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sw{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}.mini{height:30px;padding:0 14px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:12px;font-weight:600;cursor:pointer}.mini:disabled{opacity:.4;cursor:default}.out{font-size:12px;color:var(--muted);min-height:16px;margin:0}@media (prefers-reduced-motion:reduce){.pu .on i::after{animation:none;display:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const ST={online:['Online','#1f9d55','#e3f6ea','#146c3a'],busy:['Busy','#d92d20','#fde8e6','#a3201a'],away:['Away','#e8a02d','#fdf1d9','#8a5a0a'],offline:['Offline','#9a9a96','#eeeeec','#555'],error:['Error','#d92d20','#fde8e6','#a3201a']},ppl=[['Maya Chen','MC','#c2410c','online'],['Noah Silva','NS','#2563eb','busy'],['Priya Nair','PN','#7c3aed','away'],['Omar Haddad','OH','#0f766e','offline'],['Sync bot','SB','#475569','error']],ls=document.getElementById('ls'),pu=document.getElementById('pu'),out=document.getElementById('out');const ORD=['online','busy','away','offline'];
function draw(){ls.parentNode.classList.toggle('pu',pu.checked);ls.innerHTML=ppl.map(p=>{const s=ST[p[3]];return '<li><span class="av '+(p[3]==='online'||p[3]==='error'?'on':'')+'" style="background:'+p[2]+';--c:'+s[1]+'">'+p[1]+'<i></i></span><span class="nm">'+p[0]+'</span><span class="bd" style="--bg2:'+s[2]+';--c2:'+s[3]+'">'+(p[3]==='error'?'\u26A0 ':'')+s[0]+'</span></li>';}).join('');}
pu.addEventListener('change',draw);document.getElementById('cy').addEventListener('click',()=>{const m=ppl[0];m[3]=ORD[(ORD.indexOf(m[3])+1)%4];draw();out.textContent='Maya Chen is now '+ST[m[3]][0]+'.';});draw();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Status Badges with Live Dot — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ls{list-style:none;display:grid;gap:6px}.ls li{display:flex;align-items:center;gap:10px;padding:6px 8px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:13px}.av{position:relative;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font:700 11px system-ui;color:#fff;flex:none}.av i{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;border:2px solid #fff;background:var(--c)}.pu .on i::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--c);animation:pl 2s ease-out infinite}@keyframes pl{from{transform:scale(.6);opacity:.8}to{transform:scale(1.6);opacity:0}}.nm{flex:1}.bd{font-size:11px;font-weight:700;padding:2px 8px;border-radius:99px;background:var(--bg2);color:var(--c2);display:inline-flex;gap:4px;align-items:center}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sw{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}.mini{height:30px;padding:0 14px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:12px;font-weight:600;cursor:pointer}.mini:disabled{opacity:.4;cursor:default}.out{font-size:12px;color:var(--muted);min-height:16px;margin:0}@media (prefers-reduced-motion:reduce){.pu .on i::after{animation:none;display:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><ul class="ls" id="ls"></ul><div class="two"><label class="sw"><input id="pu" type="checkbox" checked> Pulse live status</label><button class="mini" id="cy" type="button">Change Maya’s status</button></div><p class="out" id="out" role="status"></p></div>
</div>
<script>
const ST={online:['Online','#1f9d55','#e3f6ea','#146c3a'],busy:['Busy','#d92d20','#fde8e6','#a3201a'],away:['Away','#e8a02d','#fdf1d9','#8a5a0a'],offline:['Offline','#9a9a96','#eeeeec','#555'],error:['Error','#d92d20','#fde8e6','#a3201a']},ppl=[['Maya Chen','MC','#c2410c','online'],['Noah Silva','NS','#2563eb','busy'],['Priya Nair','PN','#7c3aed','away'],['Omar Haddad','OH','#0f766e','offline'],['Sync bot','SB','#475569','error']],ls=document.getElementById('ls'),pu=document.getElementById('pu'),out=document.getElementById('out');const ORD=['online','busy','away','offline'];
function draw(){ls.parentNode.classList.toggle('pu',pu.checked);ls.innerHTML=ppl.map(p=>{const s=ST[p[3]];return '<li><span class="av '+(p[3]==='online'||p[3]==='error'?'on':'')+'" style="background:'+p[2]+';--c:'+s[1]+'">'+p[1]+'<i></i></span><span class="nm">'+p[0]+'</span><span class="bd" style="--bg2:'+s[2]+';--c2:'+s[3]+'">'+(p[3]==='error'?'\u26A0 ':'')+s[0]+'</span></li>';}).join('');}
pu.addEventListener('change',draw);document.getElementById('cy').addEventListener('click',()=>{const m=ppl[0];m[3]=ORD[(ORD.indexOf(m[3])+1)%4];draw();out.textContent='Maya Chen is now '+ST[m[3]][0]+'.';});draw();
</script>
</body></html>