---
name: select
kind: component
lang: cpp
domain: core
version: "1.0.0"
purity: impure
signature: "bool fn_ui::select(const char* label, int* selected_idx, const char* const* options, int count, bool allow_none = false)"
description: "Select/dropdown ImGui con label muted, estilo surface+border y opcion '(none)' opcional"
tags: [imgui, select, dropdown, form, ui, tokens]
uses_functions: ["tokens_cpp_core"]
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: [imgui]
tested: true
tests:
  - "compiles and links against Catch2 (placeholder, visual cubierto en 0048)"
test_file_path: "cpp/tests/test_select.cpp"
file_path: "cpp/functions/core/select.cpp"
framework: imgui
params:
  - name: label
    desc: "Label mostrado arriba, tambien usado como id (prefijado con ##)"
  - name: selected_idx
    desc: "Puntero a int con el indice seleccionado. -1 = ninguno (solo si allow_none)"
  - name: options
    desc: "Array de C-strings con las opciones visibles"
  - name: count
    desc: "Numero de opciones"
  - name: allow_none
    desc: "Si true, aparece '(none)' como opcion inicial con indice -1"
output: "true el frame en que la seleccion cambio"
---

# select

Label muted + combo estilizado con tokens. Apto para campos de formulario (lang, domain, project parent).

## Ejemplo

```cpp
static int lang_idx = 0;
const char* langs[] = {"go", "py", "ts", "sh", "cpp"};
fn_ui::select("Language", &lang_idx, langs, 5);

// Con opcion "ninguno"
static int project_idx = -1;
fn_ui::select("Project", &project_idx, project_names.data(),
              (int)project_names.size(), true);
```
