File to context (Pro)
ProIncluded in $99Hand the model a file: drag it from the tree as a tilting chip and drop it into the composer.
On this page
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
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
import { FileToContext } from "@/components/ui/chatcn/pro/file-to-context"
<FileToContext files={paths} value={context} onValueChange={setContext} />Props
| Prop | Type | Notes |
|---|---|---|
files | string[] | Paths in the tree |
value / onValueChange | string[] | Paths in context, in order |
placeholder / label | string | Composer text and tree header |
Keyboard
| Key | Action |
|---|---|
Enter / Space on a file | Add 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.