Logo
Navigation

UI Navigation Container

Manage tab order, selection recovery, and navigation boundaries

Overview

UI Navigation Container coordinates keyboard and controller selection inside a panel. It combines the old Tab Navigation and UI Navigation Fallback workflows.


Usage

Add the component to a panel containing Selectables.

Enable Auto Fetch On Enable, or populate Interactive Elements yourself.

Choose hierarchy or positional tab order and whether navigation wraps.

Set a default selection and a recovery policy for invalid or lost selection.

Exclude controls that should not appear in the tab order.


Tips

  • Restrict Navigation keeps directional navigation within the container.
  • Select On Enable controls initial selection; Ensure Selection restores selection when needed.
  • Restore Selection On Disable returns focus when the panel closes.

Notes

The EventSystem must use InputSystemUIInputModule.


Public API

Use UINavigationContainer in the Evo.UI namespace.

Fields

NameTypeDescription
interactiveElementsList<Selectable>Controls managed by this container.
excludedFromTabOrderList<Selectable>Controls skipped by tab navigation.
tabOrderTabOrderHierarchy or Position ordering.
wrapAroundboolWraps tab navigation at the ends.
defaultSelectionSelectablePreferred initial/default control.
fallbackSelectionSelectableFallback when recovering selection.
ensureSelectionboolKeeps a valid selection when possible.

Methods

NameParametersDescription
RefreshNavigation()NoneRefreshes collected controls and navigation.
FetchInteractables()NoneCollects Selectables.
ApplyNavigationRestrictions()NoneApplies container boundaries.
RestoreNavigation()NoneRestores original navigation settings.
SelectDefault()NoneAttempts to select the default control. Returns bool.
RestoreSelection()NoneAttempts recovery using the configured policy. Returns bool.
TabToNext()bool reverse = falseMoves forward; pass true to move backward.

Example

UINavigationContainerExample.cs
using UnityEngine;
using Evo.UI;

public class UINavigationContainerExample : MonoBehaviour
{
    [SerializeField] private UINavigationContainer target;

    private void Start()
    {
        target.RefreshNavigation();
        target.SelectDefault();
    }
}

On this page