# #114 — Quick-Capture Floating Sheet with Smart Token Chips

> Natural-language quick-add sheet that parses due dates, priorities, and projects into live removable token chips.

## Metadata

- **Index**: #114
- **Slug**: `quick-capture-token-sheet`
- **Kind**: `ui`
- **Family**: Input & Capture
- **Theme**: `light`
- **Mobile Strength**: `native-first`
- **Tags**: `quick-capture`, `token-chips`, `nlp-input`, `task-entry`, `floating-sheet`
- **Best For**: Task & reminder apps, CRM quick-log bars, Expense & time loggers, Note & bookmark capture
- **Real-World Inspiration**: [Todoist](https://todoist.com)
- **Detail Page**: https://templates.michaelpitts.net/t/quick-capture-token-sheet
- **Live Demo**: https://templates.michaelpitts.net/demos/quick-capture-token-sheet.html
- **JSON API**: https://templates.michaelpitts.net/api/templates/quick-capture-token-sheet

## Why This Aesthetic Is Unique

Eliminates multi-field form friction by letting users type or tap smart tokens (tomorrow, p1, #design) and see structured metadata materialize inline.

## Color Palette

| Role | Name | Hex |
|------|------|-----|
| `canvas` | Warm Ivory | `#FAF8F5` |
| `surface` | Sheet White | `#FFFFFF` |
| `ink` | Charcoal Ink | `#1F1D1A` |
| `accent` | Signal Terracotta | `#DC4C3E` |
| `muted` | Stone Muted | `#78716C` |

## Typography

- **Display**: `Plus Jakarta Sans`
- **Body**: `Inter`
- **Mono**: `JetBrains Mono`
- **Scale Notes**: Generous 16-17px input field text (preventing iOS auto-zoom) paired with crisp 12px color-coded token pills.
- **Google Fonts**: https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&family=Plus+Jakarta+Sans:wght@700&display=swap
  ```html
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&family=Plus+Jakarta+Sans:wght@700&display=swap">
  ```

## Layout Architecture

Clean task list backdrop with a bottom-right FAB that opens a floating capture sheet containing live input, parsed token strip, quick-insert pills, and submit button.

## Interaction & Micro-Motion Rules

Typing keywords like 'tomorrow', 'fri', 'p1', '#design', or '@mobile' live-extracts removable token chips; tapping quick pills inserts tokens with one thumb tap.

## Mobile & Responsive Rules

16px+ input font avoids mobile browser zoom jumps, and horizontal quick-token pills sit directly above the submit bar.

## Agent Guardrails

### DO
- Make every auto-parsed token chip individually removable with a single tap in case of false positives
- Provide tap-to-insert quick chips for users who prefer tapping over memorizing shorthand syntax
- Keep the input font-size at least 16px on mobile so iOS Safari does not zoom the viewport on focus

### DON'T
- Do not require users to open 3 separate date/priority/project modals just to capture a simple item
- Do not clear the user's draft text if they accidentally tap outside without confirming

## Complete Standalone Starter Code

File: `demos/quick-capture-token-sheet.html`

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Quick Capture — Smart Token Sheet</title>
<style>
  :root {
    --canvas: #FAF8F5;
    --surface: #FFFFFF;
    --ink: #1F1D1A;
    --accent: #DC4C3E;
    --accent-hover: #C13B2E;
    --muted: #78716C;
    --border: #E7E2DA;
    --chip-date-bg: #ECFDF5;
    --chip-date-ink: #047857;
    --chip-p1-bg: #FEF2F2;
    --chip-p1-ink: #DC2626;
    --chip-p2-bg: #FFF7ED;
    --chip-p2-ink: #D97706;
    --chip-p3-bg: #EFF6FF;
    --chip-p3-ink: #2563EB;
    --chip-proj-bg: #F3F0FF;
    --chip-proj-ink: #6D28D9;
    --chip-label-bg: #F0F9FF;
    --chip-label-ink: #0369A1;
    --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    min-height: 100dvh;
    line-height: 1.45;
    overflow-x: hidden;
  }

  .shell {
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 16px 120px;
  }

  @media (min-width: 720px) {
    .shell { padding: 36px 24px 100px; }
  }

  .header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
  }

  .header h1 {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.025em;
    color: var(--ink);
  }

  .header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
  }

  .counter-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
  }

  /* Floating Quick-Capture Sheet */
  .capture-sheet {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 14px 16px 12px;
    box-shadow: 0 12px 32px rgba(31, 29, 26, 0.08), 0 2px 6px rgba(31, 29, 26, 0.04);
    margin-bottom: 24px;
    transition: border-color 0.18s, box-shadow 0.18s;
  }

  .capture-sheet:focus-within {
    border-color: rgba(220, 76, 62, 0.55);
    box-shadow: 0 16px 38px rgba(220, 76, 62, 0.10), 0 2px 8px rgba(31, 29, 26, 0.05);
  }

  .input-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .capture-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    padding: 6px 0;
  }

  .capture-input::placeholder {
    color: #A8A29E;
    font-weight: 400;
  }

  /* Parsed Token Chips */
  .parsed-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    margin-top: 8px;
  }

  .parsed-chips:empty { margin-top: 0; }

  .token-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    animation: popIn 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  }

  @keyframes popIn {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: scale(1); }
  }

  .token-chip.date { background: var(--chip-date-bg); color: var(--chip-date-ink); }
  .token-chip.p1 { background: var(--chip-p1-bg); color: var(--chip-p1-ink); }
  .token-chip.p2 { background: var(--chip-p2-bg); color: var(--chip-p2-ink); }
  .token-chip.p3 { background: var(--chip-p3-bg); color: var(--chip-p3-ink); }
  .token-chip.project { background: var(--chip-proj-bg); color: var(--chip-proj-ink); }
  .token-chip.label { background: var(--chip-label-bg); color: var(--chip-label-ink); }

  .chip-remove {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chip-remove:hover { background: rgba(0, 0, 0, 0.16); }

  /* Quick-tap suggestion pills */
  .quick-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #F1ECE4;
  }

  .quick-pill {
    min-height: 36px;
    padding: 0 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--canvas);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.14s;
  }

  .quick-pill:hover {
    background: #F3EFE9;
    color: var(--ink);
    border-color: #D6CFC5;
  }

  .quick-pill.active {
    background: #1F1D1A;
    color: #FFFFFF;
    border-color: #1F1D1A;
  }

  .sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
  }

  .parse-hint {
    font-size: 12px;
    color: var(--muted);
  }

  .add-btn {
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
  }

  .add-btn:hover { background: var(--accent-hover); }
  .add-btn:active { transform: scale(0.97); }
  .add-btn:disabled { opacity: 0.45; cursor: not-allowed; }

  /* Filter tabs */
  .filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }

  .filter-btn {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
  }

  .filter-btn:hover { background: rgba(31, 29, 26, 0.05); color: var(--ink); }
  .filter-btn[aria-selected="true"] {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
    box-shadow: 0 2px 6px rgba(31, 29, 26, 0.04);
  }

  /* Task list */
  .task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: opacity 0.2s, transform 0.2s, border-color 0.15s;
    animation: slideDown 0.22s ease-out;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .task-card.done { opacity: 0.55; }
  .task-card.done .task-title { text-decoration: line-through; color: var(--muted); }

  .check-btn {
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid #C7C0B6;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: all 0.15s;
    position: relative;
  }

  /* 44px touch target expander */
  .check-btn::after {
    content: "";
    position: absolute;
    inset: -10px;
  }

  .check-btn.p1 { border-color: #DC2626; background: rgba(220, 38, 38, 0.06); }
  .check-btn.p2 { border-color: #D97706; background: rgba(217, 119, 6, 0.06); }
  .check-btn.p3 { border-color: #2563EB; background: rgba(37, 99, 235, 0.06); }

  .task-card.done .check-btn {
    background: var(--muted);
    border-color: var(--muted);
  }

  .check-svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transition: opacity 0.15s;
  }
  .task-card.done .check-svg { opacity: 1; }

  .task-body { flex: 1; min-width: 0; }
  .task-title {
    font-size: 15px;
    font-weight: 550;
    color: var(--ink);
    word-break: break-word;
  }

  .task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }

  .meta-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
  }
  .meta-tag.date { background: var(--chip-date-bg); color: var(--chip-date-ink); }
  .meta-tag.p1 { background: var(--chip-p1-bg); color: var(--chip-p1-ink); }
  .meta-tag.p2 { background: var(--chip-p2-bg); color: var(--chip-p2-ink); }
  .meta-tag.p3 { background: var(--chip-p3-bg); color: var(--chip-p3-ink); }
  .meta-tag.project { background: var(--chip-proj-bg); color: var(--chip-proj-ink); }
  .meta-tag.label { background: var(--chip-label-bg); color: var(--chip-label-ink); }

  .empty-state {
    text-align: center;
    padding: 36px 16px;
    color: var(--muted);
    font-size: 14px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 14px;
  }

  /* Floating mobile quick-focus FAB */
  .fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(220, 76, 62, 0.38);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.15s;
  }
  .fab:hover { transform: scale(1.06); }
  .fab:active { transform: scale(0.95); }
</style>
</head>
<body>
<div class="shell">
  <header class="header">
    <div>
      <h1>Inbox</h1>
      <p>Type natural tokens like <strong>tomorrow</strong>, <strong>p1</strong>, <strong>#design</strong>, or <strong>@mobile</strong></p>
    </div>
    <div class="counter-pill" id="countPill">4 remaining</div>
  </header>

  <section class="capture-sheet" aria-label="Quick Capture Task Composer">
    <form id="captureForm" autocomplete="off">
      <div class="input-row">
        <input
          id="taskInput"
          class="capture-input"
          type="text"
          placeholder="Ship onboarding audit tomorrow p1 #design @mobile"
          aria-label="New task with smart tokens"
        >
      </div>

      <div class="parsed-chips" id="parsedChips" aria-live="polite"></div>

      <div class="quick-bar" aria-label="One-tap smart token pills">
        <button type="button" class="quick-pill" data-token="tomorrow">tomorrow</button>
        <button type="button" class="quick-pill" data-token="fri">fri</button>
        <button type="button" class="quick-pill" data-token="p1">p1</button>
        <button type="button" class="quick-pill" data-token="p2">p2</button>
        <button type="button" class="quick-pill" data-token="#design">#design</button>
        <button type="button" class="quick-pill" data-token="#launch">#launch</button>
        <button type="button" class="quick-pill" data-token="@mobile">@mobile</button>
      </div>

      <div class="sheet-footer">
        <span class="parse-hint" id="parseHint">Tokens extract automatically as you type</span>
        <button type="submit" class="add-btn" id="addBtn" disabled>Add task</button>
      </div>
    </form>
  </section>

  <nav class="filters" role="tablist" aria-label="Filter tasks">
    <button class="filter-btn" role="tab" data-filter="all" aria-selected="true">All</button>
    <button class="filter-btn" role="tab" data-filter="#design" aria-selected="false">#design</button>
    <button class="filter-btn" role="tab" data-filter="#launch" aria-selected="false">#launch</button>
    <button class="filter-btn" role="tab" data-filter="p1" aria-selected="false">Priority 1</button>
    <button class="filter-btn" role="tab" data-filter="@mobile" aria-selected="false">@mobile</button>
  </nav>

  <ul class="task-list" id="taskList"></ul>
</div>

<button class="fab" id="fabBtn" aria-label="Focus quick capture" title="Quick Add (Q)">+</button>

<script>
(() => {
  const DATE_MAP = {
    today: 'Today',
    tomorrow: 'Tomorrow',
    mon: 'Mon', tue: 'Tue', wed: 'Wed', thu: 'Thu', fri: 'Fri', sat: 'Sat', sun: 'Sun'
  };

  let tasks = [
    {
      id: 1,
      title: 'Finalize iOS gesture spec for bottom sheets',
      date: 'Tomorrow',
      priority: 'p1',
      project: '#design',
      labels: ['@mobile'],
      done: false
    },
    {
      id: 2,
      title: 'Review App Store release screenshots with marketing',
      date: 'Fri',
      priority: 'p2',
      project: '#launch',
      labels: ['@review'],
      done: false
    },
    {
      id: 3,
      title: 'Audit keyboard focus ring contrast on light cards',
      date: 'Today',
      priority: 'p2',
      project: '#design',
      labels: [],
      done: false
    },
    {
      id: 4,
      title: 'Draft v2.4 changelog notes for beta testers',
      date: 'Fri',
      priority: 'p3',
      project: '#launch',
      labels: ['@mobile'],
      done: false
    }
  ];

  let nextId = 5;
  let activeFilter = 'all';

  const input = document.getElementById('taskInput');
  const chipsEl = document.getElementById('parsedChips');
  const addBtn = document.getElementById('addBtn');
  const parseHint = document.getElementById('parseHint');
  const taskList = document.getElementById('taskList');
  const countPill = document.getElementById('countPill');
  const quickPills = document.querySelectorAll('.quick-pill');

  function parseInput(raw) {
    const tokens = [];
    const words = raw.split(/\s+/).filter(Boolean);
    const cleanWords = [];

    let date = null;
    let priority = null;
    let project = null;
    const labels = [];

    for (const w of words) {
      const lower = w.toLowerCase();
      if (!date && DATE_MAP[lower]) {
        date = DATE_MAP[lower];
        tokens.push({ type: 'date', raw: w, display: date });
      } else if (!priority && /^p[1-3]$/.test(lower)) {
        priority = lower;
        tokens.push({ type: lower, raw: w, display: lower.toUpperCase() });
      } else if (!project && /^#[a-z0-9_-]+$/i.test(w)) {
        project = lower;
        tokens.push({ type: 'project', raw: w, display: project });
      } else if (/^@[a-z0-9_-]+$/i.test(w) && !labels.includes(lower)) {
        labels.push(lower);
        tokens.push({ type: 'label', raw: w, display: lower });
      } else {
        cleanWords.push(w);
      }
    }

    return {
      cleanTitle: cleanWords.join(' ').trim(),
      date,
      priority,
      project,
      labels,
      tokens
    };
  }

  function removeTokenFromInput(rawToken) {
    const escaped = rawToken.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    const regex = new RegExp(`(^|\\s)${escaped}(?=\\s|$)`, 'i');
    input.value = input.value.replace(regex, ' ').replace(/\s+/g, ' ').trim();
    if (input.value) input.value += ' ';
    renderComposer();
    input.focus();
  }

  function renderComposer() {
    const parsed = parseInput(input.value);
    chipsEl.innerHTML = '';

    for (const t of parsed.tokens) {
      const chip = document.createElement('span');
      chip.className = `token-chip ${t.type}`;
      chip.innerHTML = `<span>${t.display}</span><button type="button" class="chip-remove" aria-label="Remove ${t.display}">&times;</button>`;
      chip.querySelector('.chip-remove').addEventListener('click', () => removeTokenFromInput(t.raw));
      chipsEl.appendChild(chip);
    }

    // Highlight active quick pills
    const activeRaws = new Set(parsed.tokens.map(t => t.raw.toLowerCase()));
    quickPills.forEach(pill => {
      pill.classList.toggle('active', activeRaws.has(pill.dataset.token.toLowerCase()));
    });

    addBtn.disabled = parsed.cleanTitle.length === 0;
    if (parsed.tokens.length > 0 && parsed.cleanTitle) {
      parseHint.textContent = `Will save as "${parsed.cleanTitle}"`;
    } else if (parsed.tokens.length > 0) {
      parseHint.textContent = 'Add a task title alongside your tokens';
    } else {
      parseHint.textContent = 'Tokens extract automatically as you type';
    }
  }

  function renderTasks() {
    const filtered = tasks.filter(t => {
      if (activeFilter === 'all') return true;
      if (activeFilter === 'p1') return t.priority === 'p1';
      if (activeFilter.startsWith('#')) return t.project === activeFilter;
      if (activeFilter.startsWith('@')) return t.labels.includes(activeFilter);
      return true;
    });

    const remaining = tasks.filter(t => !t.done).length;
    countPill.textContent = `${remaining} remaining`;

    if (filtered.length === 0) {
      taskList.innerHTML = `<li class="empty-state">No tasks match <strong>${activeFilter}</strong>. Capture one above!</li>`;
      return;
    }

    taskList.innerHTML = '';
    for (const task of filtered) {
      const li = document.createElement('li');
      li.className = `task-card${task.done ? ' done' : ''}`;

      const tags = [];
      if (task.date) tags.push(`<span class="meta-tag date">${task.date}</span>`);
      if (task.priority) tags.push(`<span class="meta-tag ${task.priority}">${task.priority.toUpperCase()}</span>`);
      if (task.project) tags.push(`<span class="meta-tag project">${task.project}</span>`);
      for (const lbl of task.labels) tags.push(`<span class="meta-tag label">${lbl}</span>`);

      li.innerHTML = `
        <button class="check-btn ${task.priority || ''}" aria-label="Mark ${task.title} ${task.done ? 'incomplete' : 'complete'}">
          <svg class="check-svg" viewBox="0 0 16 16"><polyline points="3.5 8.5 6.8 11.8 12.8 4.8"/></svg>
        </button>
        <div class="task-body">
          <div class="task-title"></div>
          ${tags.length ? `<div class="task-meta">${tags.join('')}</div>` : ''}
        </div>
      `;
      li.querySelector('.task-title').textContent = task.title;
      li.querySelector('.check-btn').addEventListener('click', () => {
        task.done = !task.done;
        renderTasks();
      });
      taskList.appendChild(li);
    }
  }

  input.addEventListener('input', renderComposer);

  quickPills.forEach(pill => {
    pill.addEventListener('click', () => {
      const tok = pill.dataset.token;
      const parsed = parseInput(input.value);
      const exists = parsed.tokens.find(t => t.raw.toLowerCase() === tok.toLowerCase());
      if (exists) {
        removeTokenFromInput(exists.raw);
      } else {
        const val = input.value.trim();
        input.value = val ? `${val} ${tok} ` : `${tok} `;
        renderComposer();
        input.focus();
      }
    });
  });

  document.getElementById('captureForm').addEventListener('submit', e => {
    e.preventDefault();
    const parsed = parseInput(input.value);
    if (!parsed.cleanTitle) return;

    tasks.unshift({
      id: nextId++,
      title: parsed.cleanTitle,
      date: parsed.date,
      priority: parsed.priority,
      project: parsed.project,
      labels: parsed.labels,
      done: false
    });

    input.value = '';
    renderComposer();
    renderTasks();
  });

  document.querySelectorAll('.filter-btn').forEach(btn => {
    btn.addEventListener('click', () => {
      document.querySelectorAll('.filter-btn').forEach(b => b.setAttribute('aria-selected', 'false'));
      btn.setAttribute('aria-selected', 'true');
      activeFilter = btn.dataset.filter;
      renderTasks();
    });
  });

  document.getElementById('fabBtn').addEventListener('click', () => {
    window.scrollTo({ top: 0, behavior: 'smooth' });
    input.focus();
  });

  document.addEventListener('keydown', e => {
    if (e.key === 'q' && document.activeElement !== input && !e.metaKey && !e.ctrlKey) {
      e.preventDefault();
      input.focus();
    }
  });

  renderComposer();
  renderTasks();
})();
</script>
</body>
</html>
```
