Select<T> is a compact dropdown control. It opens a popup list and closes when:
var select = new Select<string>()
.Items(["First", "Second", "Third"]);
The selected value is SelectedIndex (single selection).
Select<T> uses a single ItemTemplate for:
When ItemTemplate is empty, the control resolves a display template from the environment (DataTemplates).
If no template is found, it falls back to rendering value.ToString() in a TextBlock.
To render richer content, set ItemTemplate:
using XenoAtom.Terminal.UI.Templating;
var placements = new Select<PopupPlacement>()
.Items([PopupPlacement.Below, PopupPlacement.Above, PopupPlacement.Right, PopupPlacement.Left])
.ItemTemplate(new DataTemplate<PopupPlacement>(
Display: static (DataTemplateValue<PopupPlacement> value, in DataTemplateContext _) =>
new HStack(Symbols.ArrowRight, new TextBlock(() => value.GetValue().ToString())).Spacing(1),
Editor: null));
Enter confirms the current selection.Tab / Escape closes the popup.HorizontalAlignment = Align.Start, VerticalAlignment = Align.StartSelectStyle controls padding, arrow glyph, and colors for the collapsed control and the popup surface.