Empty Chat Welcome Screen
The first screen of a new chat: a greeting, example prompts, what the assistant can do and its limits, with the prompt box ready below.
One HTML file with the CSS and JavaScript inside. No library needed. MIT license.
How to use it
- Click Copy the code, or download the file.
- Paste the CSS into your stylesheet, the HTML where you want the component, and the script before the closing body tag.
- Change
--accentat the top of the CSS to your brand color, then connect the events to your AI service.
What you get
- Works in light and dark mode automatically
- Keyboard friendly, with labels for screen readers
- Fits phones, tablets and desktops
- Respects the reduced motion setting
- No framework, so it works with any stack
The code
<!DOCTYPE html>
<!--
Empty Chat Welcome Screen: a free AI UI component
From 100 Free AI UI Components by MM Rahman Bappi, MIT license
https://mmrahmanbappi.github.io/100-free-ai-ui-components/
How to use: copy the CSS, HTML and JavaScript below into your page.
Colors are CSS variables at the top. Change --accent to match your brand.
Light and dark themes follow the visitor's system setting, or set
data-theme="dark" or data-theme="light" on the html element.
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Empty Chat Welcome Screen | Free AI UI Component</title>
<meta name="description" content="The first screen of a new chat: a greeting, example prompts, what the assistant can do and its limits, with the prompt box ready below.">
<meta name="robots" content="noindex, follow">
<style>
:root{
--accent:#5b5bd6; --accent-ink:#fff; --accent-soft:#ececfc;
--bg:#f7f7f8; --surface:#fff; --surface-2:#f1f1f4; --ink:#17171c; --text:#3a3a44; --muted:#6c6c78;
--line:#e3e3e8; --good:#15803d; --warn:#b45309; --bad:#c62828;
--radius:14px; --shadow:0 1px 2px rgba(20,20,30,.06),0 8px 24px -12px rgba(20,20,30,.18);
--font:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,sans-serif; --mono:ui-monospace,"Cascadia Code",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
--accent:#8b8bff; --accent-ink:#0f0f16; --accent-soft:#25254a;
--bg:#0f0f13; --surface:#18181f; --surface-2:#212129; --ink:#f3f3f6; --text:#d4d4dc; --muted:#9a9aa8;
--line:#2c2c36; --good:#4ade80; --warn:#fbbf24; --bad:#f87171; --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -12px rgba(0,0,0,.6);
}}
:root[data-theme=dark]{
--accent:#8b8bff; --accent-ink:#0f0f16; --accent-soft:#25254a;
--bg:#0f0f13; --surface:#18181f; --surface-2:#212129; --ink:#f3f3f6; --text:#d4d4dc; --muted:#9a9aa8;
--line:#2c2c36; --good:#4ade80; --warn:#fbbf24; --bad:#f87171; --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -12px rgba(0,0,0,.6);
}
*{box-sizing:border-box}
html,body{margin:0}
body{min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding:24px;background:var(--bg);color:var(--text);font:15px/1.5 var(--font);-webkit-font-smoothing:antialiased}
button,input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition:none!important}}
/* ---- component ---- */
.msgs{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.m{max-width:80%;padding:9px 13px;border-radius:14px;line-height:1.55;font-size:14px;overflow-wrap:anywhere;animation:pop .2s ease}
.m.u{align-self:flex-end;background:var(--accent);color:var(--accent-ink);border-bottom-right-radius:4px}
.m.a{align-self:flex-start;background:var(--surface-2);color:var(--text);border-bottom-left-radius:4px}
@keyframes pop{from{opacity:0;transform:translateY(5px)}}
.pb{display:flex;gap:8px;align-items:flex-end;padding:10px;border-top:1px solid var(--line);background:var(--surface)}
.pb textarea{flex:1;border:1px solid var(--line);border-radius:12px;padding:9px 12px;resize:none;background:var(--surface);color:var(--ink);max-height:120px;line-height:1.45;min-width:0}
.pb textarea:focus{outline:0;border-color:var(--accent)}
.send{width:38px;height:38px;border-radius:11px;border:0;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;cursor:pointer;flex:none}
.send:disabled{opacity:.35;cursor:not-allowed}
.ib{width:34px;height:34px;display:grid;place-items:center;border:0;background:none;color:var(--muted);border-radius:9px;cursor:pointer;flex:none}
.ib:hover{background:var(--surface-2);color:var(--ink)}
.win{width:min(100%,760px);display:flex;flex-direction:column;gap:18px}
.hi{text-align:center}.logo{width:48px;height:48px;border-radius:14px;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;margin:0 auto 10px}
.hi h1{font-size:24px;margin:0;color:var(--ink)}.hi p{margin:4px 0 0;color:var(--muted)}
.cols{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.col h2{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin:0 0 8px;text-align:center}
.col ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.col li{background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:9px 11px;font-size:13.5px;line-height:1.4}
.col button{width:100%;text-align:left;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:11px;padding:9px 11px;font-size:13.5px;cursor:pointer;line-height:1.4}
.col button:hover{border-color:var(--accent);background:var(--accent-soft)}
.box{border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.box .pb{border-top:0}
@media(max-width:640px){.cols{grid-template-columns:1fr}}
</style>
</head>
<body>
<main class="win">
<div class="hi"><div class="logo" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8z"/></svg></div><h1>How can I help today?</h1><p>Ask a question or pick an example to start.</p></div>
<div class="cols">
<section class="col"><h2>Examples</h2><ul>
<li style="padding:0;border:0"><button type="button">Explain quantum computing in simple words</button></li>
<li style="padding:0;border:0"><button type="button">Write a thank you note to a teacher</button></li>
<li style="padding:0;border:0"><button type="button">Plan a week of easy dinners</button></li></ul></section>
<section class="col"><h2>What I can do</h2><ul><li>Remember what you said earlier in this chat</li><li>Let you correct me and try again</li><li>Summarize files you upload</li></ul></section>
<section class="col"><h2>Limits</h2><ul><li>I can make mistakes, so check important facts</li><li>I may not know very recent events</li><li>I do not give medical or legal decisions</li></ul></section>
</div>
<div class="box"><form class="pb" id="pf"><label class="sr" for="pq">Message</label><textarea id="pq" rows="1" placeholder="Message the assistant"></textarea><button class="send" id="ps" type="submit" aria-label="Send message" disabled><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5M5 12l7-7 7 7"/></svg></button></form></div>
</main>
<script>
// Demo helper: add ?theme=dark or ?theme=light to the address to preview a theme.
(function(){var t=new URLSearchParams(location.search).get('theme');if(t)document.documentElement.dataset.theme=t;})();
var q=document.getElementById('pq'),s=document.getElementById('ps');
document.querySelectorAll('.col button').forEach(function(b){b.addEventListener('click',function(){q.value=b.textContent;s.disabled=false;q.focus();});});
q.addEventListener('input',function(){s.disabled=!q.value.trim();});
document.getElementById('pf').addEventListener('submit',function(e){e.preventDefault();q.value='';s.disabled=true;});
</script>
</body>
</html>
More chat layouts components
Full Chat Window
A complete chat screen with a header, scrolling messages and a prompt box at the bottom. Replies stream in, and the view follows along.
Chat Sidebar
A sidebar with past chats grouped by date, a New chat button and the current chat highlighted. On phones it slides in from a menu button.
Floating Chat Widget
A round chat button in the corner that opens a small chat panel, with an unread badge. Escape or the close button hides it again.
Split View: Chat and Document
Chat on one side and a live document on the other, the layout used by AI writing tools. On phones it switches to two tabs.
Mobile Chat Screen
A phone-sized chat with a back button, assistant name and status, messages, and a prompt bar with an attach button, sized for thumbs.
Conversation Search
Search through past chats as you type. Matching words are highlighted, and a friendly message appears when nothing is found.