Recommended Patterns
Prefer Signals for UI State
Use LuiSignal<T> for UI that changes from user interaction.
Key Dynamic Lists
Lui.ForEach(items.Value, item => Row(item).Key(item.Id))Use Memo for Stable Expensive Sections
Lui.Memo(() => InventoryGrid(items.Value), items.Value)Only memoize when you can list the dependencies correctly.
Use Refs for Per-Frame Values
Use refs for health bars, timers, shake offsets, and other values that change every frame.
Keep Modals Inside an Overlay Host
LuiOverlay.Host("relative min-h-[600px]",
MainPanel(),
LuiOverlay.Modal(...)
)Use Button().Background(...) for Skinned Buttons
Lui.Button("Play", "w-64 h-20 text-white", Play).Background(buttonSprite)This is clearer than ImageButton and supports the same hover/active background helpers.
Last updated on