gpui-kit GitHub

Components

SchemaForm view

A form built from a schema.

A view survives a frame. Hold it in an Entity with cx.new(..) and reach it with .update(..).

use gpui_kit::structured::SchemaForm;

Construct

new(ident: impl Into<Ident>, schema: Schema, window: &mut Window, cx: &mut Context<Self>) -> Self

Commands

Need a Context, so they need a view.

set_error(path: impl Into<SharedString>, message: impl Into<SharedString>, cx: &mut Context<Self>)
clear_host_errors(cx: &mut Context<Self>)
validate(cx: &mut Context<Self>) -> bool
set_disabled(disabled: bool, cx: &mut Context<Self>)

Queries

Only answer; they change nothing.

values(cx: &App) -> Vec<(SharedString, FieldValue)>
unrenderable() -> &[UnrenderableField]
has_unrenderable_required() -> bool

Reports

The variants of the event it emits. It never applies the change itself.

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/structured/schema_form.rs