@if (activeTab == 0) { } else if (activeTab == 1) { } @code { private int activeTab = 0; private string GetTabClass(int tabId) => tabId == activeTab ? "tablinks active" : "tablinks"; private void SwitchTabs(int tabId) { activeTab = tabId; } }