Skip to content
Sign upGet access
MicrointeractionsFile to contextMenu

File to context (Pro)

ProIncluded in $99

Hand the model a file: drag it from the tree as a tilting chip and drop it into the composer.

ProDrag a file out of the tree and it hangs from your pointer as a chip, tilting as you move; drop it on the composer and it lands in a slot that opens for it. Click throws it along an arc.

Drag a file out of the tree and it lifts into a chip that hangs from your pointer, tilting with the speed you move it. The composer lights up as you cross it, and letting go there drops the chip into the context row, which opens a slot for it. Let go anywhere else and it slides home. A click or Enter throws the chip along an arc into the same slot, so keyboard and mouse get the same story.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/file-to-context

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { FileToContext } from "@/components/ui/chatcn/pro/file-to-context"

<FileToContext files={paths} value={context} onValueChange={setContext} />

Props

PropTypeNotes
filesstring[]Paths in the tree
value / onValueChangestring[]Paths in context, in order
placeholder / labelstringComposer text and tree header

Keyboard

KeyAction
Enter / Space on a fileAdd it to context

Accessibility

  • Files are buttons named Add, or in context; chips have a named remove button.

Motion

  • The chip follows the pointer with a tilt from its speed; drops land in 300 ms, throws arc in 520 ms. Reduced motion: chips just appear.