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.
It would be useful to have a reusable
Uploadcomponent 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
A basic usage could look like:
Or provide a default dropzone-style UI:
Use cases
This would be useful for common desktop application scenarios such as:
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.