Controls
Dropdowns
Choose one stable-ID item from a bounded popup list.
The site build compiles the dedicated Ada component example, constructs Dropdowns through its public API, and exports that exact styled surface. Read the capture source.
When to use it
Use a dropdown when one choice must fit in a compact closed control. Prefer radio buttons when you want all choices to remain visible.
State and ownership
The Flyology_TUI.Components.Dropdowns package defines this component.
The model retains selected ID, highlight, open state, focus, and capture. Item labels are supplied by the generic instance.
- The application model owner applies updates during serial event dispatch.
- Appearance and skin values are borrowed only while the component renders.
Input and updates
Enter or Space opens a closed dropdown. In an open dropdown, either key commits the highlighted item. Escape or a click outside the popup closes it without changing the selection. Arrow keys and wheel movement change the highlight.
Integration sequence
- Create the bounded model and populate it with caller-owned data.
- Route the current keyboard or local mouse event through the component handler.
- Apply the typed result, then render from the updated model with the current appearance.
See the linked package reference for its exact declarations and contracts.
Responsive and accessible behavior
- Use dimensions and regions from the current layout or presentation value.
- When a component owns mouse capture, route its matching release even when the pointer leaves the original bounds.
- Retain a glyph, label, border, or text-attribute cue when the terminal reduces color.