gpui-kit GitHub

Components

Dropzone builder

An area that accepts a drop.

A builder is RenderOnce. Construct and mount it in one expression.

use gpui_kit::controls::Dropzone;

Construct

new(ident: impl Into<Ident>, label: impl Into<SharedString>) -> Self

Options

Chain onto the value.

hint(hint: impl Into<SharedString>) -> Self
refusal(refusal: impl Into<SharedString>) -> Self
accepts<S: Into<SharedString>>(kinds: impl IntoIterator<Item = S>) -> Self
icon(icon: Icon) -> Self
state(state: DropzoneState) -> Self
on_drop(handler: impl Fn(&DragItem, &mut Window, &mut App) + 'static) -> Self
on_files(handler: impl Fn(&ExternalPaths, &mut Window, &mut App) + 'static) -> Self

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/controls/dropzone.rs