Vibary.ai
← Vibe Coding

Context Pill Attach

A dragged file is caught by the prompt bar and lands inside it as a context pill.

aifriendlyminimalinteraction · finite · advanced · ~0.5s
Interactive · click to play
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

389 lines · react + motion only
import { useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Context Pill Attach
 *
 * Dragging a file onto the prompt bar. Release it over the bar and it
 * stops being a file: it becomes a context pill sitting inside the

About this pattern

Attaching context is a promise that the assistant will actually read the thing, so the drop has to be unambiguous. The bar arms as the card crosses the threshold, the card leaves downward on release, and the pill lands inside the bar on a tightly damped spring while a ring at the bar edge fades once to confirm the catch. Nothing about the card scales while it is held — only its shadow answers the grab, because a filename stretched under the pointer is the cheapest looking drag there is.

Attach a file as contextDrop a document on a composerAdd a reference to a promptRemove attached context

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • Summarise the supplier contract and flag anything unusual.
    The renewal runs another twelve months at the same rate, with one clause worth a second look.
    Supplier contract.docxQ3 planning notes
    Ask a follow-up
    AI assistant

    Files dropped on the composer become compact chips inside the prompt before it is sent.

Related patterns