Skip to content

Feature: Add Upload component #3170

Description

@ayangweb

It would be useful to have a reusable Upload component for handling file and folder uploads in desktop applications.

The component could support both traditional file selection and drag-and-drop interactions, providing a consistent way to handle file imports across applications.

Proposed features

  • Click to open a native file picker
  • Drag and drop files
  • Support multiple files
  • Optional folder selection
  • Configurable accepted file types
  • Disabled state
  • Drag-over state
  • Callback when files are selected or dropped

A basic usage could look like:

Upload::new()
    .accept(["png", "jpg", "zip"])
    .multiple(true)
    .on_change(...)
    .child(...)

Or provide a default dropzone-style UI:

┌──────────────────────────────────┐
│                                  │
│      Drop files here             │
│      or click to browse          │
│                                  │
└──────────────────────────────────┘

Use cases

This would be useful for common desktop application scenarios such as:

  • Importing files or folders
  • Importing models or assets
  • Adding images
  • Importing configuration files
  • Drag-and-drop workflows

Implementation

The component could build on existing file picker and drag-and-drop capabilities where possible, while leaving the exact API and implementation details to gpui-kit.

The goal is to provide a reusable abstraction for file import interactions rather than requiring each application to implement the same behavior independently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions