Files
egutierrez 7c86070cc6 docs(registry): tested:true + test_file_path en .md de primitivos
20 funciones C++ pasan de tested:false a tested:true con sus tests
correspondientes y test_file_path apuntando a cpp/tests/. Cubre 4 tests
reales (tween_curves, pie/kpi/bar math) y 16 placeholders (componentes
UI con tests visuales pendientes para 0048).

Coverage cpp pasa de 4% (3/81) a 28% (23/81).
2026-04-28 23:42:35 +02:00

2.0 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports tested tests test_file_path file_path framework params output
button component cpp core 1.0.0 pure bool fn_ui::button(const char* label, fn_ui::ButtonVariant variant = Secondary, fn_ui::ButtonSize size = Md) Boton ImGui con variantes (primary/secondary/subtle/danger) y tamanos (sm/md/lg) usando fn_tokens. Replica Mantine Button / fn_library Button.
imgui
button
ui
form
tokens
tokens_cpp_core
false
imgui
true
compiles and links against Catch2 (placeholder, visual cubierto en 0048)
cpp/tests/test_button.cpp cpp/functions/core/button.cpp imgui
name desc
label Texto visible del boton (tambien se usa como id ImGui; prefijar con ## para solo-id)
name desc
variant ButtonVariant: Primary (indigo), Secondary (surface+border, default), Subtle (transparente), Danger (rojo)
name desc
size ButtonSize: Sm (compacto), Md (default), Lg (grande, font x1.1)
true el frame en que se hace click, false en caso contrario

button

Boton con variantes semanticas y tamanos fijos. Usa tokens (primary, surface, error, border, text) y padding/radius consistentes — mismo estilo visual en cualquier app C++ que lo use.

Variantes

Variant Uso Colores
Primary Accion principal (Save, Submit) colors::primary + hover
Secondary Accion neutra (Cancel) surface + border
Subtle Accion discreta (ver mas) transparente + hover surface
Danger Accion destructiva (Delete) colors::error

Ejemplo

#include "core/button.h"
using fn_ui::button;
using V = fn_ui::ButtonVariant;

if (button("Reindex", V::Primary)) { ... }
if (button("Cancel",  V::Subtle))  { ... }
if (button("Delete",  V::Danger))  { ... }

Notas

  • No gestiona layout: usar ImGui::SameLine() o toolbar para alinear varios.
  • Para botones solo-icono sin texto, usar icon_button.