Coachmark Onboarding Tour
A three-step product tour: a dimmed screen with a spotlight on one control, a short tip, Next, Back and Skip.
AI prompt
Clean UI mockup of a dashboard with a dim dark overlay and a bright rounded spotlight cutout around the Search field in the header, a white tip card with a small arrow below it reading Find anything instantly, three progress dots with the first one filled, a Skip text button and a primary Next button, the rest of the interface dimmed and slightly visible, light theme, flat modern style. Negative: heavy shadows, clutter, text errors, device frames. Reduced motion: static design.About this pattern
Definition
A coachmark tour introduces a new interface by highlighting one control at a time. The rest of the screen is dimmed so the target stands out, and a small card beside it explains what it does. Done well it is short, skippable and easy to restart.
Purpose & UX principles
- Keep it to three to five steps; each step names one control and one benefit.
- Cut a hole in the dim layer with a large box-shadow around the target rectangle.
- Place the tip card beside the target and flip it if it would leave the screen.
- Move focus into the tip, support Escape to close, and return focus to the page afterwards.
Interaction states
- Start tour, then use Next, Back, Skip or Escape.
Motion specification
- The spotlight slides between targets in 250ms.
- Reduced motion: it jumps.
Responsive behaviour
- Always offer Skip and a way to reopen the tour later.
- Do not auto-start tours on every visit; show them once.
Code
<div class="bx"><div class="app" id="app"><header><b>Acme</b><span class="t" id="t1">Search</span><button class="t" id="t2" type="button">New</button><i class="t av" id="t3"></i></header><main><i></i><i></i><i></i></main><div class="ov" id="ov" hidden><div class="sp" id="sp"></div><div class="tp" id="tp" role="dialog" aria-label="Product tour" tabindex="-1"><b id="tt"></b><p id="tx"></p><div class="ft"><button class="sk" id="sk" type="button">Skip</button><span class="dt" id="dt"></span><button class="mini" id="bk" type="button">Back</button><button class="mini pri" id="nx" type="button">Next</button></div></div></div></div><button class="mini" id="st" type="button">Start tour</button></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}
.app{position:relative;height:170px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.app header{display:flex;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);font-size:12px}.app header b{margin-right:auto}.app .t{padding:5px 12px;border:1px solid var(--line);border-radius:8px;background:#fafaf8}.app .av{width:26px;height:26px;border-radius:50%;padding:0;background:#c9d6f5}.app main{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:12px}.app main i{height:60px;border-radius:10px;background:#f1f1ef}.ov{position:absolute;inset:0;z-index:5}.sp{position:absolute;border-radius:10px;box-shadow:0 0 0 999px rgba(15,18,30,.62);transition:all .25s;pointer-events:none}.tp{position:absolute;width:204px;box-sizing:border-box;background:#fff;border-radius:10px;padding:10px;box-shadow:0 8px 24px rgba(0,0,0,.28);font-size:12px;transition:all .25s;outline:none}.tp b{font-size:13px}.tp p{margin:4px 0 8px;color:#555;line-height:1.4}.ft{display:flex;align-items:center;gap:6px}.sk{font-size:11px;color:#666;text-decoration:underline;margin-right:auto}.dt{display:flex;gap:3px}.dt i{width:6px;height:6px;border-radius:50%;background:#d6d6d2}.dt i.on{background:#171717}.mini{height:26px;padding:0 10px}.mini.pri{background:#171717;color:#fff}.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,.tp{transition:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const S=[['t1','Search','Find anything in your workspace instantly.'],['t2','Create','Start a new project from here.'],['t3','Your profile','Open settings and sign out.']],app=document.getElementById('app'),ov=document.getElementById('ov'),sp=document.getElementById('sp'),tp=document.getElementById('tp'),st=document.getElementById('st');let n=0;
function show(){const t=document.getElementById(S[n][0]),a=app.getBoundingClientRect(),r=t.getBoundingClientRect(),pad=4;sp.style.left=(r.left-a.left-pad)+'px';sp.style.top=(r.top-a.top-pad)+'px';sp.style.width=(r.width+pad*2)+'px';sp.style.height=(r.height+pad*2)+'px';
document.getElementById('tt').textContent=S[n][1];document.getElementById('tx').textContent=S[n][2];document.getElementById('dt').innerHTML=S.map((s,i)=>'<i class="'+(i===n?'on':'')+'"></i>').join('');document.getElementById('bk').disabled=n===0;document.getElementById('nx').textContent=n===S.length-1?'Done':'Next';
let x=r.left-a.left+r.width/2-102;x=Math.max(6,Math.min(a.width-210,x));tp.style.left=x+'px';tp.style.top=(r.bottom-a.top+pad+10)+'px';}
function open(){n=0;ov.hidden=false;show();tp.focus();}
function close(){ov.hidden=true;st.focus();}
st.addEventListener('click',open);document.getElementById('sk').addEventListener('click',close);document.getElementById('bk').addEventListener('click',()=>{if(n>0){n--;show();}});document.getElementById('nx').addEventListener('click',()=>{if(n<S.length-1){n++;show();}else close();});
app.addEventListener('keydown',e=>{if(!ov.hidden&&e.key==='Escape'){e.preventDefault();close();}});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>Coachmark Onboarding Tour — 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}
.app{position:relative;height:170px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.app header{display:flex;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);font-size:12px}.app header b{margin-right:auto}.app .t{padding:5px 12px;border:1px solid var(--line);border-radius:8px;background:#fafaf8}.app .av{width:26px;height:26px;border-radius:50%;padding:0;background:#c9d6f5}.app main{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:12px}.app main i{height:60px;border-radius:10px;background:#f1f1ef}.ov{position:absolute;inset:0;z-index:5}.sp{position:absolute;border-radius:10px;box-shadow:0 0 0 999px rgba(15,18,30,.62);transition:all .25s;pointer-events:none}.tp{position:absolute;width:204px;box-sizing:border-box;background:#fff;border-radius:10px;padding:10px;box-shadow:0 8px 24px rgba(0,0,0,.28);font-size:12px;transition:all .25s;outline:none}.tp b{font-size:13px}.tp p{margin:4px 0 8px;color:#555;line-height:1.4}.ft{display:flex;align-items:center;gap:6px}.sk{font-size:11px;color:#666;text-decoration:underline;margin-right:auto}.dt{display:flex;gap:3px}.dt i{width:6px;height:6px;border-radius:50%;background:#d6d6d2}.dt i.on{background:#171717}.mini{height:26px;padding:0 10px}.mini.pri{background:#171717;color:#fff}.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,.tp{transition:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="app" id="app"><header><b>Acme</b><span class="t" id="t1">Search</span><button class="t" id="t2" type="button">New</button><i class="t av" id="t3"></i></header><main><i></i><i></i><i></i></main><div class="ov" id="ov" hidden><div class="sp" id="sp"></div><div class="tp" id="tp" role="dialog" aria-label="Product tour" tabindex="-1"><b id="tt"></b><p id="tx"></p><div class="ft"><button class="sk" id="sk" type="button">Skip</button><span class="dt" id="dt"></span><button class="mini" id="bk" type="button">Back</button><button class="mini pri" id="nx" type="button">Next</button></div></div></div></div><button class="mini" id="st" type="button">Start tour</button></div>
</div>
<script>
const S=[['t1','Search','Find anything in your workspace instantly.'],['t2','Create','Start a new project from here.'],['t3','Your profile','Open settings and sign out.']],app=document.getElementById('app'),ov=document.getElementById('ov'),sp=document.getElementById('sp'),tp=document.getElementById('tp'),st=document.getElementById('st');let n=0;
function show(){const t=document.getElementById(S[n][0]),a=app.getBoundingClientRect(),r=t.getBoundingClientRect(),pad=4;sp.style.left=(r.left-a.left-pad)+'px';sp.style.top=(r.top-a.top-pad)+'px';sp.style.width=(r.width+pad*2)+'px';sp.style.height=(r.height+pad*2)+'px';
document.getElementById('tt').textContent=S[n][1];document.getElementById('tx').textContent=S[n][2];document.getElementById('dt').innerHTML=S.map((s,i)=>'<i class="'+(i===n?'on':'')+'"></i>').join('');document.getElementById('bk').disabled=n===0;document.getElementById('nx').textContent=n===S.length-1?'Done':'Next';
let x=r.left-a.left+r.width/2-102;x=Math.max(6,Math.min(a.width-210,x));tp.style.left=x+'px';tp.style.top=(r.bottom-a.top+pad+10)+'px';}
function open(){n=0;ov.hidden=false;show();tp.focus();}
function close(){ov.hidden=true;st.focus();}
st.addEventListener('click',open);document.getElementById('sk').addEventListener('click',close);document.getElementById('bk').addEventListener('click',()=>{if(n>0){n--;show();}});document.getElementById('nx').addEventListener('click',()=>{if(n<S.length-1){n++;show();}else close();});
app.addEventListener('keydown',e=>{if(!ov.hidden&&e.key==='Escape'){e.preventDefault();close();}});
</script>
</body></html>