---
name: text_input
kind: component
lang: cpp
domain: core
version: "1.0.0"
purity: impure
signature: "bool fn_ui::text_input(const char* label, char* buf, size_t buf_size, const char* placeholder = nullptr)"
description: "Input de texto ImGui con label muted arriba, estilo surface+border, placeholder opcional. Muta buf."
tags: [imgui, input, form, ui, text, 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_text_input.cpp"
file_path: "cpp/functions/core/text_input.cpp"
framework: imgui
params:
  - name: label
    desc: "Label mostrado arriba del input, tambien usado como id (prefijado con ##)"
  - name: buf
    desc: "Buffer char* donde se escribe el valor (se muta in-place)"
  - name: buf_size
    desc: "Tamano en bytes del buffer"
  - name: placeholder
    desc: "Hint mostrado en text_dim cuando buf esta vacio (opcional)"
output: "true el frame en que el valor cambio"
---

# text_input

Label muted + input de texto estilizado con tokens. Full-width dentro del contenedor.

## Ejemplo

```cpp
static char name[128] = {};
static char desc[256] = {};
fn_ui::text_input("Name",        name, sizeof(name), "my-new-app");
fn_ui::text_input("Description", desc, sizeof(desc));
```
