Share one SelectModel between the dropdown and its choices. This example uses OneApp’s desktop host on Linux, Windows, or macOS on Apple silicon.
dotnet add package RecursiveAI.OneApp.Kit dotnet add package RecursiveAI.OneApp dotnet add package RecursiveAI.OneUI
Requires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
<!-- Delivery: SelectModel in DeliveryPage.cs. --> <SelectBox Model="{Delivery}" TriggerId="shipping" AriaLabel="Delivery method"> <SelectItem Model="{Delivery}" Value="standard" Text="Standard" /> <SelectItem Model="{Delivery}" Value="express" Text="Express" /> </SelectBox>
The example is the full program below: unzip it and dotnet run.
The dropdown starts on Standard and lets the user choose Express.
Full program
OneApp hosts the window, OneApp.Kit supplies the controls, and OneUI compiles the .html component.
The zip contains the three files below and Demo.csproj. To make the project by hand, create a .NET 10 console app and install the packages above. The example’s project references are:
<PackageReference Include="RecursiveAI.OneApp" Version="1.1.1" /> <PackageReference Include="RecursiveAI.OneApp.Kit" Version="1.1.1" /> <PackageReference Include="RecursiveAI.OneUI" Version="1.1.0" />
OneUI compiles DeliveryPage.html into the other half of the partial class in DeliveryPage.cs, supplying the base component whose OnMounted method the example overrides. Save these files beside the project file.
DeliveryPage.html:
<Theme> <main style="padding: 24px"> <Label For="shipping">Delivery method</Label> <SelectBox Model="{Delivery}" Id="shipping-options" TriggerId="shipping" AriaLabel="Delivery method" Placeholder="Choose delivery" Width="180px"> <SelectItem Model="{Delivery}" Value="standard" Text="Standard" /> <SelectItem Model="{Delivery}" Value="express" Text="Express" /> </SelectBox> </main> </Theme>
DeliveryPage.cs:
using OneApp.Kit; public partial class DeliveryPage { public SelectModel Delivery { get; } = new("standard"); protected override void OnMounted() => Delivery.ValueChanged += Report; protected override void OnDisposed() => Delivery.ValueChanged -= Report; private static void Report(string? value) => Console.WriteLine($"Delivery: {value}"); }
Program.cs opens the native window. Checked on Linux (X11) with OneApp 1.1.1:
using OneApp; using var host = AppHost.Create(new AppOptions(new DeliveryPage()) { Title = "Delivery", Width = 420, Height = 300, }); host.Run();
Press Tab to focus the dropdown, Down Arrow to open it, Down Arrow again to highlight Express, and Enter to commit. The trigger now says Express, and the terminal prints:
Delivery: expressIf a choice doesn’t update the trigger, check that the SelectBox and every SelectItem use the same SelectModel instance.

Variations
To open the list under the trigger instead of aligning the selected item with it, add Position to the opening tag in DeliveryPage.html:
<SelectBox Model="{Delivery}" Id="shipping-options" TriggerId="shipping" AriaLabel="Delivery method" Placeholder="Choose delivery" Width="180px" Position="{OneApp.Kit.SelectPosition.Below}">
Related recipes
The short answer
Bind SelectBox and each SelectItem to one C# SelectModel. Use Text for the label and Value for the stored identifier. Read Delivery.Value to get the chosen identifier or handle ValueChanged to react when it changes.
How do I set the choices and default value in a C# dropdown?
Start the model with a value that matches one of the items. The sample starts with standard, so the control displays Standard. For a required choice with no default, start with a model that has no value, set Placeholder, and check for a choice before proceeding. Give options unique, stable values so changing a label doesn’t change the data your app stores. Use SelectBox for a choice the app keeps; use a command menu for actions such as Print or Export.
How do I use a select dropdown with the keyboard?
The trigger is a select-only combobox: it has a list of choices but no editable text field. Use AriaLabel for the control’s name, TriggerId to connect the visible Label, and Id for the listbox. Focus stays on the trigger while aria-activedescendant identifies the highlighted option. Arrow keys move the highlight; Home and End go to the first or last choice. Enter or Space commits it, Tab commits and moves on, and Escape closes without committing. Typing a letter can jump to a matching label; on the closed control it chooses the match.