gpui-kit GitHub

Components

SegmentedControl builder

A strip where exactly one segment holds.

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

use gpui_kit::controls::SegmentedControl;

Construct

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

Options

Chain onto the value.

label(label: impl Into<SharedString>) -> Self
segments(segments: impl IntoIterator<Item = Segment>) -> Self
selected(id: impl Into<SharedString>) -> Self
on_select(handler: impl Fn(SharedString, &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/segmented.rs