Playground GitHub npm

Select

Trigger + PopupWindow dropdown (close-on-click-outside).

ui form

Preview

Installation

npx slintcn@latest add select

Usage

import { Select, SelectItem } from "slintcn/components/select.slint";

Select {
    items: [{ label: "Monthly" }, { label: "Yearly (-20%)" }];
    selected-index <=> billing;
    changed(i) => { /* … */ }
}

Properties

items in [SelectItem]

Options shown in the dropdown.

selected-index in-out int

Two-way; index of the chosen item, or -1 for no selection.

placeholder in string

Shown when nothing is selected.

disabled in bool

When true, the trigger dims and stops opening.

highlighted-index in-out int

Internal — which item is highlighted by arrow keys inside the popup.

changed callback (int)

Fired with the new `selected-index` when the user picks an item.

API

Accessibility
focusableyes
keyboardEnterSpace
Escapedismisses

Dependencies

iconlucide-paths

Installed automatically as transitive dependencies of slintcn add select.