Skip to content

Swipe deck

A review queue for agent output. Throw the top card right to approve and left to skip; it follows your pointer, the cards behind rise, and a card dragged only part way springs back. Buttons, the arrow keys and Undo do the same.

On this page
Used for
  • Approving drafts
  • Reviewing suggested refunds
  • Triaging generated images
  • Overnight agent output
  • Moderation queues

Examples

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

itemsrequired
SwipeItem[]
{ id, title, kind?, visual?, body?, meta? }, first on top. `visual` is the one big object of the card (an amount, a message bubble, a few rows); `body` is clamped to two lines. Controlled: remove an item when onDecide fires.
onDeciderequired
(item, 'approve' | 'skip') => void
Fires at once when a card is thrown right (approve) or left (skip), by pointer, button or key. It does not wait for the animation.
onUndo
(item, decision) => void
Undo the last decision: put the item back at the front of items. Without it the Undo button is hidden.
renderCard
(item) => ReactNode
Defaultkind, title, visual, body, meta
Draw a card yourself: a person, a generated image, a diff. The demo passes SwipeDeckProfileCard.
SwipeDeckProfileCard
{ name, role?, company?, avatar?, tint?, reason?, tags? }
A ready-made person card: a portrait panel on the person's own soft tint (top 55%), the name, role and company, the agent's reason as a chip and up to two tags. For leads, candidates and contacts.
threshold
number
Default0.3
Share of the card's width a drag must pass. A fast throw decides sooner.
visible
number
Default3
How many cards show. The ones behind sit smaller, lower and dimmer, and rise as you drag.
height / labels / empty / label
number / { approve, skip } / ReactNode / string
Default364 / Approve, Skip / Queue clear / Review queue
Card area height with the 24px where the cards behind show (the default card is 272 by 340, 4:5), the words on the stamps and buttons, the empty state and the name of the group.
Keyboard
group
Right approves, left skips, U or Ctrl/Cmd+Z undoes. The deck is one tab stop.
Motion
drag, throw, return
The card follows the pointer with no easing and turns around the point it was grabbed at. A throw takes 280 ms (ease out), the spring back 280 ms. Reduced motion makes both instant.
a11y
group
A named group; each decision is announced in a polite status (Approved: title). The stamps are decoration; the buttons name the action.

What it handles

  1. 01Shows the queue as a stack: the top card is the one to decide, the next two sit smaller, lower and dimmer behind it.
  2. 02Follows the pointer directly and turns around the point it was grabbed at; the cards behind rise as you drag and a stamp (Approve or Skip) fades in.
  3. 03Decides when the card passes 30% of its width or is thrown fast: right approves, left skips, and onDecide fires at once.
  4. 04Springs back when released under the threshold, so a half-hearted drag never decides.
  5. 05Does the same from the Skip and Approve buttons and the Left and Right arrow keys, and undoes the last decision with Undo or U.
  6. 06Says what happened to a screen reader in a polite status, and shows a Queue clear state with the counts when the queue is empty.

States

First render
Nothing plays. The stack is as given
none
Dragging
The top card follows the pointer and tilts; the stamp fades in with the drag; the cards behind rise
none, direct
Release past the threshold or a fast throw
The card flies off and fades; the next card moves up
280ms, ease out
Release under the threshold
The card springs back to the stack
280ms, small spring
Button or arrow key
The same throw, from rest
280ms, ease out
Undo
The previous card is back on top, as you return it in items
none
Reduced motion
A decision and the return are instant
0ms

Works with

When to use

When to use

  • Going through a queue of finished agent output (draft replies, suggested refunds, generated images) with one decision per card.
  • A review that has to be quick and reversible, on a phone or with the keyboard.

When not to use

  • One action an agent wants to take right now, with its consequences spelled out: use Approval Prompt.
  • A long list you read and act on in any order: use Agent Inbox.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Swipe Deck to my app and wire it to my own data.
  • I need going through a queue of finished agent output (draft replies, suggested refunds, generated images) with one decision per card. Set that up with the Knowns UI Swipe Deck.
  • Which Swipe Deck props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "swipe-deck" }) and search_docs({ query: "swipe deck" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Swipe Deck, or found something off? We read every message.