vercel / vercel/ai-elements

Add preview card with modal for pasted long content in PromptInput

Open
#333 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.4k
Forks
283
Avg merge
32m
Merged PRs (30d)
1

Description

Currently, when pasting long text into PromptInput, the entire content is displayed inline, which can make the input area unwieldy.

Expected behavior:
Long pasted content should be displayed as a compact preview card (similar to Claude.ai and v0.app), showing:

  • A truncated preview of the content
  • File size and line count
  • A "PASTED" badge/indicator
  • Clicking the card opens a modal/dialog with the full content
  • Modal should include actions to copy or download the pasted content

Current behavior:
All pasted text appears directly in the textarea, regardless of length.

Screenshots:

Image Image Image Image

Suggested implementation:
Add a PromptInputPastedContent component that detects large pastes (e.g., >200 characters or >10 lines) and displays them as a clickable preview card above the textarea. The card should trigger a modal/dialog showing the full content with copy and download actions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the existing PromptInput implementation and inspect how pasted text is handled. Add the proposed PromptInputPastedContent entry point for large pastes, with a truncated card showing size, line count, and a PASTED indicator, then verify that opening it reveals the full content with copy and download actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.