Select
Picks one item from a list that floats under its trigger.
Installation
bash
shellui-native add select
Platforms: MAUI · Avalonia. Also installs icon.
Usage
Basic
Give it strings through ItemsSource; SelectedIndex is the pick (-1 for none).
<ui:Select Placeholder="Select a platform" ItemsSource="{Binding Platforms}" /><ui:Select Placeholder="Select a platform" ItemsSource="{Binding Platforms}" />Not available on yet
csharp
public IList<string> Platforms { get; } = [".NET MAUI", "Avalonia", "Blazor"];
MAUI and Avalonia
The same API. MAUI draws its own list instead of the platform picker, so it looks the same on every OS.
API
| Property | Type | Default | Description |
|---|---|---|---|
SelectedIndex |
int |
-1 |
Index of the selected item; -1 for none. Two-way bindable. |
ItemsSource |
IList<string> (MAUI) · IList<string>? (Avalonia) |
null |
Items to choose from; shown with ToString(). |
Placeholder |
string |
"Select..." |
Hint shown while empty. |
| Event | Arguments | Description |
|---|---|---|
SelectedIndexChanged |
— | User input only: setting SelectedIndex from code or a binding doesn't raise it. |
| Method | Description |
|---|---|
SetOpen(bool open) |
Opens or closes it. |
Close() |
Closes it. |