# llimphi-widget-select Modern *select* / dropdown control. Modelled as a **gradient of complexity**: the same piece serves everything from the dumbest select to one with async loading and badges, without changing widget — you just switch layers on. ```text ┌──────────────────────────────┐ │ ◷ Pending ● ▾ │ ← trigger (closed) └──────────────────────────────┘ │ click → view_overlay ▼ ┃ ⌕ Search… ← search box (layer 2) ┃ ✓ ◷ Pending 12 ← rich item: check · icon · label · badge (layer 3) ┃ ◔ In progress 3 ┃ ◉ Done · ← dot badge ┃ ───────────────────── ┃ ⟳ Loading… ← async state (layer 4): Loading / Error+retry / empty ``` ## The four layers 1. **Simple select.** `SelectItem::new` + `select_trigger_view` (the closed button showing the choice) + `select_menu_view` with `SelectPhase::Ready` mounted in `App::view_overlay`. `on_pick(idx)` returns the **original** index of the chosen item; the app stores it and closes the menu. That is all. 2. **Searchable (combobox).** Set `searchable: true`. The box on top paints `query`; the app routes typing through `on_key` into a `TextInputState` and re-filters with `filter`. `step_active` moves the highlight with ↑/↓ skipping disabled entries; `resolve` translates the highlighted position back to the original index for Enter. 3. **Rich items + badges.** Every `SelectItem` carries `icon`, `sublabel` and a `SelectBadge` (a `12` count, a `beta` text chip, or a status dot) — reusing `llimphi-widget-badge`. Multiple selection falls out for free: pass several indices in `selected` and the menu paints a ✓ on each (the toggle/close semantics are the app's call). 4. **Async loading.** The menu does not require having the data: `SelectPhase` distinguishes `Loading` (a "Loading…" row), `Error` (message + an `on_retry` action) and `Ready`. The pattern: the app opens the menu, fires `Handle::spawn`, paints `Loading`, and switches to `Ready` when the worker returns. A *generation* (`u64`) discards stale answers if the user reopened or retyped — see the `select_demo` example. The look is that of `context-menu`: a rounded panel with a hairline border, rows as pills with a soft hover, an accent indicator on the active row, and a full-screen scrim that dismisses on click-outside. --- Part of **llimphi** — see [llimphi](../../README.md).