100 Free AI UI Components

Editable Task Plan

The agent proposes a step by step plan before it starts. People can reorder, edit or remove steps, then approve the plan to run it.

One HTML file with the CSS and JavaScript inside. No library needed. MIT license.

Live preview

How to use it

  1. Click Copy the code, or download the file.
  2. Paste the CSS into your stylesheet, the HTML where you want the component, and the script before the closing body tag.
  3. Change --accent at 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>
<!--
  Editable Task Plan: 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>Editable Task Plan | Free AI UI Component</title>
<meta name="description" content="The agent proposes a step by step plan before it starts. People can reorder, edit or remove steps, then approve the plan to run it.">
<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 ---- */
.wrap{width:min(100%,620px);display:flex;flex-direction:column;gap:14px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px 18px}
.card h2{font-size:15px;margin:0 0 4px;color:var(--ink)}
.muted{color:var(--muted);font-size:13px}
.num{font-variant-numeric:tabular-nums}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:10px;padding:8px 14px;font-size:14px;font-weight:600;cursor:pointer}
.btn:hover{border-color:var(--accent)}.btn.pri{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.sm{padding:5px 10px;font-size:13px;border-radius:8px}
.ib{width:28px;height:28px;display:grid;place-items:center;border:0;background:none;color:var(--muted);border-radius:7px;cursor:pointer;flex:none}
.ib:hover{background:var(--surface-2);color:var(--ink)}.ib:disabled{opacity:.3;cursor:not-allowed}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;border-radius:99px;padding:2px 9px;border:1px solid}
.pill.run{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 40%,var(--line))}
.pill.ok{color:var(--good);border-color:color-mix(in srgb,var(--good) 40%,var(--line))}
.pill.bad{color:var(--bad);border-color:color-mix(in srgb,var(--bad) 40%,var(--line))}
.pill.wait{color:var(--muted);border-color:var(--line)}
pre{margin:0;font:12.5px/1.55 var(--mono);background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;overflow-x:auto;color:var(--ink)}
.tg{width:40px;height:23px;border-radius:99px;background:var(--line);position:relative;flex:none;border:0;cursor:pointer;padding:0}
.tg::after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;transition:left .15s}
.tg[aria-checked=true]{background:var(--accent)}.tg[aria-checked=true]::after{left:20px}
ol.plan{list-style:none;margin:12px 0;padding:0;display:flex;flex-direction:column;gap:6px;counter-reset:s}
ol.plan li{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:6px 6px 6px 10px;background:var(--surface);counter-increment:s}
ol.plan li::before{content:counter(s);width:22px;height:22px;border-radius:50%;background:var(--surface-2);color:var(--ink);font-size:12px;font-weight:700;display:grid;place-items:center;flex:none}
ol.plan li.done::before{content:"";background:var(--good)}
ol.plan li.run::before{border:2px solid var(--accent);border-top-color:transparent;background:none;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
ol.plan li span{flex:1;font-size:14px;color:var(--ink);min-width:0;overflow-wrap:anywhere}
ol.plan li input{flex:1;border:1px solid var(--accent);border-radius:7px;padding:5px 8px;background:var(--surface);color:var(--ink);font-size:14px;min-width:0}
.acts{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;align-items:center}
.locked .ib{visibility:hidden}
</style>
</head>
<body>
<div class="wrap"><div class="card" id="card">
  <h2>Proposed plan</h2><p class="muted" style="margin:0" id="sub">Review the steps before the assistant starts.</p>
  <ol class="plan" id="plan"></ol>
  <div class="acts"><span class="muted" id="st" role="status" aria-live="polite"></span><button class="btn pri" type="button" id="go">Approve and run</button></div>
</div></div>
<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 steps=['Read the three uploaded sales files','Combine the numbers by month','Make a chart of monthly totals','Write a one page summary'];
var plan=document.getElementById('plan'),go=document.getElementById('go'),st=document.getElementById('st'),card=document.getElementById('card'),locked=false;
var UP='<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M18 15l-6-6-6 6\"/></svg>',DN='<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\"/></svg>',PEN='<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 20h9\"/><path d=\"M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z\"/></svg>',DEL='<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3\"/></svg>';
function render(){plan.innerHTML='';steps.forEach(function(s,i){var li=document.createElement('li');li.innerHTML='<span></span><button class="ib" type="button">'+UP+'</button><button class="ib" type="button">'+DN+'</button><button class="ib" type="button">'+PEN+'</button><button class="ib" type="button">'+DEL+'</button>';
  li.querySelector('span').textContent=s;var b=li.querySelectorAll('.ib');
  [['Move up',function(){steps.splice(i-1,0,steps.splice(i,1)[0]);render();plan.children[i-1].querySelectorAll('.ib')[0].focus();},i===0],
   ['Move down',function(){steps.splice(i+1,0,steps.splice(i,1)[0]);render();plan.children[i+1].querySelectorAll('.ib')[1].focus();},i===steps.length-1],
   ['Edit step',function(){var inp=document.createElement('input');inp.value=s;inp.setAttribute('aria-label','Step '+(i+1));li.replaceChild(inp,li.querySelector('span'));inp.focus();inp.select();
      function done(k){if(k&&inp.value.trim())steps[i]=inp.value.trim();render();}inp.onkeydown=function(e){if(e.key==='Enter')done(true);if(e.key==='Escape')done(false);};inp.onblur=function(){done(true);};},false],
   ['Remove step',function(){steps.splice(i,1);render();},steps.length<=1]].forEach(function(o,k){b[k].setAttribute('aria-label',o[0]+': '+s);b[k].onclick=o[1];b[k].disabled=o[2];});
  plan.appendChild(li);});go.disabled=!steps.length||locked;}
go.addEventListener('click',function(){locked=true;card.classList.add('locked');go.disabled=true;document.getElementById('sub').textContent='Running the approved plan.';
  var lis=plan.children;[].forEach.call(lis,function(li,i){setTimeout(function(){if(i>0)lis[i-1].className='done';li.className='run';st.textContent='Step '+(i+1)+' of '+lis.length;},900*i);});
  setTimeout(function(){lis[lis.length-1].className='done';st.textContent='All steps finished';go.textContent='Done';},900*lis.length);});
render();
</script>
</body>
</html>

More agents and tools components

  • Tool Call Card

    Shows that the AI used a tool, with its name, status and time. Open it to see the exact input and the result it got back.

  • Action Approval Request

    Before an agent does something important, like sending an email, it shows exactly what it will do and waits for Allow or Deny.

  • Agent Activity Timeline

    A timeline of everything an agent did: its thinking, tool calls, results and messages, with times and a filter by type.

  • File Change Preview

    Shows the changes an AI wants to make to a file, with removed lines in red and added lines in green, and buttons to accept or reject.

  • Web Results Card

    A card listing the web pages an AI read, with title, site and a short excerpt. Pages it used in the answer are marked.

  • Agent Run Log

    A terminal style log that streams what an agent is doing, with colored levels, a pause button, auto scroll and copy.