Long Wait Status Messages
A task whose status line changes as work proceeds, adds elapsed time and gently warns when it takes longer than usual.
AI prompt
Clean UI mockup of a waiting state card in the centre of a page, a small spinner, the status line Finding key points in your document, three small step dots with the first one checked and the second active, a muted line Elapsed 0:14, below it a calm amber note Taking longer than usual with two text buttons Keep waiting and Cancel, light theme, flat modern style. Negative: gradients, heavy shadows, clutter, text errors. Reduced motion: static design.About this pattern
Definition
When a wait is longer than a few seconds, a spinner alone creates doubt. A status line that names what is happening, a visible elapsed time and an honest note when it runs long keep people informed and patient. Always offer Cancel, and never fake precise progress you do not have.
Purpose & UX principles
- Rotate honest steps, such as Reading your file, Finding key points, Writing the summary.
- Show elapsed time after a few seconds.
- After the usual duration add Taking longer than usual with the option to keep waiting or cancel.
- Use aria-live polite and update only when the step changes, not every second.
Interaction states
- Start the task; watch the steps, the elapsed timer and the long-wait note.
Motion specification
- The message fades between steps in 200ms.
- Reduced motion: it swaps without a fade.
Responsive behaviour
- Do not use jokey or misleading messages for serious tasks.
- Reduced motion: no fade between messages.
Code
<div class="bx"><div class="wc" id="wc"><div class="sp" id="sp" aria-hidden="true"></div><p class="st" id="st" aria-live="polite">Ready to start.</p><ul class="dt" id="dt"></ul><p class="el" id="el"></p><p class="lg" id="lg" hidden>Taking longer than usual. <button type="button" id="kw">Keep waiting</button></p></div><div class="two"><button class="mini" id="go" type="button">Start</button><button class="mini" id="cn" type="button" disabled>Cancel</button></div></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}
.wc{display:grid;gap:6px;justify-items:center;text-align:center;padding:16px 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);min-height:130px}.sp{width:22px;height:22px;border-radius:50%;border:3px solid #e1e1de;border-top-color:#171717;visibility:hidden}.sp.on{visibility:visible;animation:sp .8s linear infinite}@keyframes sp{to{transform:rotate(360deg)}}.st{margin:0;font-size:13.5px;font-weight:600;transition:opacity .2s}.dt{list-style:none;display:flex;gap:5px}.dt li{width:8px;height:8px;border-radius:50%;background:#d6d6d2}.dt li.d{background:#1f9d55}.dt li.a{background:#171717}.el{margin:0;font-size:11.5px;color:var(--muted);min-height:14px}[hidden]{display:none!important}.lg{margin:0;font-size:12px;color:#8a5a0a;background:#fdf1d9;padding:5px 10px;border-radius:8px}.lg button{text-decoration:underline;margin-left:6px;font-weight:600}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.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}@media (prefers-reduced-motion:reduce){.sp.on{animation:none;border-top-color:#171717;border-right-color:#171717}.st{transition:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const S=['Reading your file\u2026','Finding key points\u2026','Writing the summary\u2026'],wc=document.getElementById('wc'),st=document.getElementById('st'),sp=document.getElementById('sp'),dt=document.getElementById('dt'),el=document.getElementById('el'),lg=document.getElementById('lg'),go=document.getElementById('go'),cn=document.getElementById('cn');let t0=0,iv=null,limit=9;
function draw(s,done){dt.innerHTML=S.map((x,i)=>'<li class="'+(done||i<s?'d':i===s?'a':'')+'"></li>').join('');}
function stop(msg){clearInterval(iv);sp.classList.remove('on');go.disabled=false;go.textContent='Start';cn.disabled=true;st.textContent=msg;lg.hidden=true;}
function start(){clearInterval(iv);t0=performance.now();go.disabled=true;cn.disabled=false;sp.classList.add('on');lg.hidden=true;limit=9;let step=-1;
iv=setInterval(()=>{const s=(performance.now()-t0)/1000,ns=Math.min(2,Math.floor(s/3));if(ns!==step){step=ns;st.textContent=S[ns];draw(ns,false);}el.textContent='Elapsed '+Math.floor(s/60)+':'+String(Math.floor(s%60)).padStart(2,'0');if(s>=limit)lg.hidden=false;if(s>=15){stop('\u2713 Summary ready.');draw(3,true);}},250);}
go.addEventListener('click',start);cn.addEventListener('click',()=>{stop('Cancelled.');draw(0,false);el.textContent='';});document.getElementById('kw').addEventListener('click',()=>{lg.hidden=true;limit=999;});draw(-1,false);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>Long Wait Status Messages — 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}
.wc{display:grid;gap:6px;justify-items:center;text-align:center;padding:16px 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);min-height:130px}.sp{width:22px;height:22px;border-radius:50%;border:3px solid #e1e1de;border-top-color:#171717;visibility:hidden}.sp.on{visibility:visible;animation:sp .8s linear infinite}@keyframes sp{to{transform:rotate(360deg)}}.st{margin:0;font-size:13.5px;font-weight:600;transition:opacity .2s}.dt{list-style:none;display:flex;gap:5px}.dt li{width:8px;height:8px;border-radius:50%;background:#d6d6d2}.dt li.d{background:#1f9d55}.dt li.a{background:#171717}.el{margin:0;font-size:11.5px;color:var(--muted);min-height:14px}[hidden]{display:none!important}.lg{margin:0;font-size:12px;color:#8a5a0a;background:#fdf1d9;padding:5px 10px;border-radius:8px}.lg button{text-decoration:underline;margin-left:6px;font-weight:600}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.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}@media (prefers-reduced-motion:reduce){.sp.on{animation:none;border-top-color:#171717;border-right-color:#171717}.st{transition:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="wc" id="wc"><div class="sp" id="sp" aria-hidden="true"></div><p class="st" id="st" aria-live="polite">Ready to start.</p><ul class="dt" id="dt"></ul><p class="el" id="el"></p><p class="lg" id="lg" hidden>Taking longer than usual. <button type="button" id="kw">Keep waiting</button></p></div><div class="two"><button class="mini" id="go" type="button">Start</button><button class="mini" id="cn" type="button" disabled>Cancel</button></div></div>
</div>
<script>
const S=['Reading your file\u2026','Finding key points\u2026','Writing the summary\u2026'],wc=document.getElementById('wc'),st=document.getElementById('st'),sp=document.getElementById('sp'),dt=document.getElementById('dt'),el=document.getElementById('el'),lg=document.getElementById('lg'),go=document.getElementById('go'),cn=document.getElementById('cn');let t0=0,iv=null,limit=9;
function draw(s,done){dt.innerHTML=S.map((x,i)=>'<li class="'+(done||i<s?'d':i===s?'a':'')+'"></li>').join('');}
function stop(msg){clearInterval(iv);sp.classList.remove('on');go.disabled=false;go.textContent='Start';cn.disabled=true;st.textContent=msg;lg.hidden=true;}
function start(){clearInterval(iv);t0=performance.now();go.disabled=true;cn.disabled=false;sp.classList.add('on');lg.hidden=true;limit=9;let step=-1;
iv=setInterval(()=>{const s=(performance.now()-t0)/1000,ns=Math.min(2,Math.floor(s/3));if(ns!==step){step=ns;st.textContent=S[ns];draw(ns,false);}el.textContent='Elapsed '+Math.floor(s/60)+':'+String(Math.floor(s%60)).padStart(2,'0');if(s>=limit)lg.hidden=false;if(s>=15){stop('\u2713 Summary ready.');draw(3,true);}},250);}
go.addEventListener('click',start);cn.addEventListener('click',()=>{stop('Cancelled.');draw(0,false);el.textContent='';});document.getElementById('kw').addEventListener('click',()=>{lg.hidden=true;limit=999;});draw(-1,false);
</script>
</body></html>