Search Token Pills
A search field where a typed filter snaps into a pill the moment it is complete, proving the query was understood before any result loads.
Build a search input where typed filters become pills. Structure: a single bordered field containing a search icon, a row of pills, and the text currently being typed with a blinking caret after it. The behavior: as the user types a structured filter ("in:docs", "after:2024"), the moment it is complete it collapses into a pill and the text clears. The pill is a receipt - it tells the user the query PARSED, before a single result has loaded. That is the whole value, and it arrives before any latency could answer the question. Animation details: - Type character by character, about 55ms apart, with a caret that blinks on a 1s loop. Dropping the whole string in at once reads as a paste, and a paste has no tension. - Each pill springs in from scale 0.5 and opacity 0 at stiffness ~560, damping ~26. A fade would say "appeared"; a spring says "collapsed into an object". - Give each pill a `layout` prop inside AnimatePresence with mode="popLayout", so the typed remainder and the caret slide over as pills land rather than jumping. Each pill shows its key in muted color and its value in bold - one pill carrying two pieces of information without a second line - and carries its own remove button with an aria-label. A filter you cannot take off is a trap. Below the field, a count of applied filters with aria-live="polite", and a replay control. Under prefers-reduced-motion, render the finished query - pills placed, remaining text shown, no typing and no caret blink. Colors as tokens: paper field, one accent for the focus border, the caret, and the pill tint. Build the component, not this demo of it. - Ambient motion that IS the component may loop: a drifting background, a marquee, a spinner while something is genuinely loading. - Do not add any timer, interval, loop or script that performs a person's action by itself. No auto-hover, no auto-click, no cycling through states, no pretend submitting, no replaying the interaction on a schedule. - Every state that answers a person waits for a real event from that person. - Placeholder copy and sample content are welcome. Simulated behaviour is not.