AI Starter Suggestion Chips
An empty AI chat with starter chips by category that fill the composer, then follow-up chips after the answer.
AI prompt
Clean chat UI mockup of an empty AI assistant screen with a greeting Hi, what can I help with, below it a row of three category tabs Write, Learn and Plan, four rounded suggestion chips such as Draft a polite follow-up email and Explain how vaccines work in simple terms, and at the bottom a text field with a send button; a second state after an answer shows three smaller follow-up chips under the reply, light theme, flat modern style. Negative: robots, heavy shadows, gradients, text errors, clutter. Reduced motion: static mockup.About this pattern
Definition
A blank chat box is intimidating. Starter chips show what the assistant is good at and let people begin with one tap. Grouped by task, they teach by example. After each answer, follow-up chips suggest the next step so the conversation keeps its direction.
Purpose & UX principles
- Show three to six chips, grouped under a few short categories.
- A chip fills the composer so people can edit before sending, rather than sending at once.
- Refresh or change the chips to match the conversation after an answer.
- Write chips as real requests, not labels.
Interaction states
- Category buttons, starter chips, a composer and follow-up chips.
Motion specification
- Chips fade in over 150ms.
- Reduced motion: no fade.
Responsive behaviour
- Make chips buttons with visible focus and a clear name.
- Do not hide the free typing field; chips are help, not a replacement.
Code
<div class="bx"><div class="chat" id="chat"><div class="gr" id="gr"><b>Hi, what can I help with?</b><div class="pre" id="pre" role="group" aria-label="Category"><button data-p="0" aria-pressed="true">Write</button><button data-p="1" aria-pressed="false">Learn</button><button data-p="2" aria-pressed="false">Plan</button></div><div class="ch" id="ch"></div></div><div class="rp" id="rp" hidden></div></div><form class="cp" id="cp"><input id="in" type="text" aria-label="Message" placeholder="Ask anything"><button class="mini" type="submit">Send</button></form></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}
[hidden]{display:none!important}.chat{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:10px;min-height:120px;display:grid;align-content:start;gap:8px}.gr{display:grid;gap:8px}.gr b{font-size:14px}.ch{display:flex;flex-wrap:wrap;gap:6px}.ch button{padding:6px 11px;border-radius:99px;border:1px solid var(--line);background:#fff;font-size:12px;text-align:left;animation:fi .15s}.ch button:hover{border-color:#171717}@keyframes fi{from{opacity:0;transform:translateY(3px)}}.rp{display:grid;gap:8px;font-size:12.5px;line-height:1.5}.rp .u{justify-self:end;background:#171717;color:#fff;border-radius:12px 12px 4px 12px;padding:6px 10px;max-width:90%}.rp .a{border:1px solid var(--line);border-radius:12px 12px 12px 4px;padding:7px 10px;background:#fff}.cp{display:flex;gap:6px}.cp input{flex:1;height:34px;border:1px solid var(--line);border-radius:99px;padding:0 14px;font:inherit;font-size:12.5px;background:var(--surface);color:var(--text)}.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){.ch button{animation:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const S=[['Draft a polite follow-up email','Rewrite this paragraph to sound friendlier','Write a short product description'],['Explain how vaccines work simply','Summarise the causes of the French Revolution','Teach me the basics of budgeting'],['Plan a 3-day trip to Lisbon','Make a weekly meal plan for two','Help me prepare for a job interview']],F=['Make it shorter','Change the tone','Give me three options'],ch=document.getElementById('ch'),gr=document.getElementById('gr'),rp=document.getElementById('rp'),inp=document.getElementById('in'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function chips(){ch.innerHTML=S[p].map(t=>'<button type="button">'+t+'</button>').join('');bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;chips();}));
ch.addEventListener('click',e=>{const b=e.target.closest('button');if(!b)return;inp.value=b.textContent;inp.focus();});
function send(t){gr.hidden=true;rp.hidden=false;rp.innerHTML='<div class="u"></div><div class="a">Sure! Here is a first draft.</div><div class="ch" id="fu">'+F.map(f=>'<button type="button">'+f+'</button>').join('')+'</div>';rp.querySelector('.u').textContent=t;rp.querySelector('#fu').addEventListener('click',ev=>{const b=ev.target.closest('button');if(b){inp.value=b.textContent;inp.focus();}});inp.value='';}
document.getElementById('cp').addEventListener('submit',e=>{e.preventDefault();if(inp.value.trim())send(inp.value.trim());});chips();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>AI Starter Suggestion Chips — 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}
[hidden]{display:none!important}.chat{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:10px;min-height:120px;display:grid;align-content:start;gap:8px}.gr{display:grid;gap:8px}.gr b{font-size:14px}.ch{display:flex;flex-wrap:wrap;gap:6px}.ch button{padding:6px 11px;border-radius:99px;border:1px solid var(--line);background:#fff;font-size:12px;text-align:left;animation:fi .15s}.ch button:hover{border-color:#171717}@keyframes fi{from{opacity:0;transform:translateY(3px)}}.rp{display:grid;gap:8px;font-size:12.5px;line-height:1.5}.rp .u{justify-self:end;background:#171717;color:#fff;border-radius:12px 12px 4px 12px;padding:6px 10px;max-width:90%}.rp .a{border:1px solid var(--line);border-radius:12px 12px 12px 4px;padding:7px 10px;background:#fff}.cp{display:flex;gap:6px}.cp input{flex:1;height:34px;border:1px solid var(--line);border-radius:99px;padding:0 14px;font:inherit;font-size:12.5px;background:var(--surface);color:var(--text)}.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){.ch button{animation:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="chat" id="chat"><div class="gr" id="gr"><b>Hi, what can I help with?</b><div class="pre" id="pre" role="group" aria-label="Category"><button data-p="0" aria-pressed="true">Write</button><button data-p="1" aria-pressed="false">Learn</button><button data-p="2" aria-pressed="false">Plan</button></div><div class="ch" id="ch"></div></div><div class="rp" id="rp" hidden></div></div><form class="cp" id="cp"><input id="in" type="text" aria-label="Message" placeholder="Ask anything"><button class="mini" type="submit">Send</button></form></div>
</div>
<script>
const S=[['Draft a polite follow-up email','Rewrite this paragraph to sound friendlier','Write a short product description'],['Explain how vaccines work simply','Summarise the causes of the French Revolution','Teach me the basics of budgeting'],['Plan a 3-day trip to Lisbon','Make a weekly meal plan for two','Help me prepare for a job interview']],F=['Make it shorter','Change the tone','Give me three options'],ch=document.getElementById('ch'),gr=document.getElementById('gr'),rp=document.getElementById('rp'),inp=document.getElementById('in'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function chips(){ch.innerHTML=S[p].map(t=>'<button type="button">'+t+'</button>').join('');bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;chips();}));
ch.addEventListener('click',e=>{const b=e.target.closest('button');if(!b)return;inp.value=b.textContent;inp.focus();});
function send(t){gr.hidden=true;rp.hidden=false;rp.innerHTML='<div class="u"></div><div class="a">Sure! Here is a first draft.</div><div class="ch" id="fu">'+F.map(f=>'<button type="button">'+f+'</button>').join('')+'</div>';rp.querySelector('.u').textContent=t;rp.querySelector('#fu').addEventListener('click',ev=>{const b=ev.target.closest('button');if(b){inp.value=b.textContent;inp.focus();}});inp.value='';}
document.getElementById('cp').addEventListener('submit',e=>{e.preventDefault();if(inp.value.trim())send(inp.value.trim());});chips();
</script>
</body></html>