UI controls such as Button, Toggle and Slider support navigation.
Navigation modes include:
When opening a menu:
EventSystem.current.SetSelectedGameObject(
firstButton.gameObject
);
With Input System:
playerInput.SwitchCurrentActionMap("UI");
Switch back to gameplay when closing the menu.