KitSelectSurface
Popup surface combining native search, keyboard handling and active-option visibility.

Place a virtualized list of KitOption children and bind scroll-y to that list’s scroll position. Supply its visible height in viewport-height and a matching row-height.
searchable and focus-search-on-open choose presentation and initial focus. ensure-active-visible() follows state.active-index, while query-edited passes the search draft without deciding selection.
Complete example
This complete Slint file is a visual composition used to produce the screenshot above. Internal strings without a label property retain the kit’s default language; system dialogs follow the host platform. Projected state and callbacks requesting a decision need host wiring; the standalone fixture does not supply that controller. Set up the Rust project, then see the typed controller application for working editing, validation and selection.
// SPDX-License-Identifier: GPL-3.0-or-later
import { KitOption, KitSelectSurface, KitTheme, KitThemes, SelectionAvailability } from "@kit/kit.slint";
export component Example inherits Window {
title: "KitSelectSurface example";
preferred-width: 420px;
preferred-height: 320px;
max-width: 100000px;
max-height: 100000px;
background: root.theme.canvas;
in-out property <KitTheme> theme: KitThemes.light;
in-out property <string> status;
VerticalLayout {
padding: 24px; spacing: 16px; alignment: start;
Text { text: "Select Surface"; color: root.theme.text-primary; font-size: 20px * root.theme.text-scale; font-weight: 600; }
KitSelectSurface { theme: root.theme; height: 220px; state: { open: true, generation: 1, active-index: 0, active: { present: true, token: 11 }, selected: { present: true, token: 11 }, selection-availability: SelectionAvailability.available }; VerticalLayout { for row in [{ token: 11, generation: 1, label: "Overview", description: "Project summary", disabled: false }, { token: 23, generation: 1, label: "Activity", description: "Recent changes", disabled: false }, { token: 38, generation: 1, label: "Settings", description: "Project preferences", disabled: false }]: KitOption { theme: root.theme; option-data: row; height: 48px; Text { text: row.label; color: root.theme.text-primary; vertical-alignment: center; font-size: 14px * root.theme.text-scale; } } } }
if root.status != "": Text { text: root.status; color: root.theme.text-secondary; font-size: 12px * root.theme.text-scale; wrap: word-wrap; }
}
}
Public API
Inherits Rectangle.
The declarations below come from the component source. Parent properties remain available; see the controller guide for state management.
Properties
| Name | Type | Direction |
|---|---|---|
theme |
KitTheme |
in |
state |
SelectState |
in |
row-height |
length |
in |
viewport-height |
length |
in |
searchable |
bool |
in |
focus-search-on-open |
bool |
in |
empty |
bool |
in |
empty-label |
string |
in |
search-label |
string |
in |
query |
string |
in-out |
scroll-y |
length |
in-out |
active-scroll-y |
length |
out |
Types and variants
Names below use Slint syntax. Shared Rust domain types live in slint_kit; presentation enums come from the Rust types generated by Slint.
| Type | Declaration |
|---|---|
enum CloseReason |
escape, outside-press, system-back, trigger-toggle, programmatic, host-closed |
enum NavigationStep |
next, previous, first, last, page-next, page-previous |
enum SelectionAvailability |
absent, available, unavailable |
struct SelectionRef |
present: bool, token: int |
struct SelectState |
selection-availability: SelectionAvailability, selected: SelectionRef, active: SelectionRef, open: bool, active-index: int, generation: int |
Callbacks
navigate(NavigationStep)activate(int, int)dismiss(CloseReason)typeahead(string)tab-navigation(bool) → EventResultquery-edited(string)
Functions
take-focus()ensure-active-visible()