🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@fluentui-contrib/react-gamepad-navigation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui-contrib/react-gamepad-navigation

**Gamepad Navigation for [Fluent UI React](https://react.fluentui.dev/)**

latest
Source
npmnpm
Version
0.2.2
Version published
Weekly downloads
7
-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

@fluentui-contrib/react-gamepad-navigation

Gamepad Navigation for Fluent UI React

[!WARNING] These are not production-ready components and should never be used in product. This space is useful for testing new components whose APIs might change before final release.

This package provides gamepad navigation support for Fluent UI Components. Any gaming controller implementing the Gamepad API is supported. Major brand controllers such as Xbox, PlayStation, Nintendo, 8bit, etc. are supported.

This hook calls useArrowNavigationGroup and useFocusableGroup internally. For that reason, 'useGamepadNavigationGroup' hook uses the same API and configuration as those two previous hooks.

In addition to gamepad navigation, arrow key navigation is available by calling this hook, so there is no need to call useArrowNavigationGroup separately.

Installation

yarn add @fluentui-contrib/react-gamepad-navigation

Mappings

Controller InputMapped Behavior
'A' Button'Enter' keydown behavior
'B' Button'Escape' keydown behavior
'X' ButtonNot supported
'Y' ButtonNot supported
BumpersNot supported
DpadArrow navigation (up/down/left/right)
Left StickArrow navigation (up/down/left/right)
Right StickNot supported
TriggersNot supported

Components Support

Single Elements

ComponentSupport
Buttonâś… Supported
Checkboxâś… Supported
Comboboxâś… Supported
Dropdownâś… Supported
Inputâś… Supported
Linkâś… Supported
Menuâś… Supported
RadioGroup⚠️ Partial Support
Selectâ›” Not Supported
Sliderâ›” Not Supported
SpinButtonâ›” Not Supported
Switchâś… Supported
Textareaâś… Supported

[!NOTE] There will be no support for select native element, you should use Dropdown or Combobox components instead.

Composed Elements

ComponentSupport
Accordionâś… Supported
Breadcrumbâś… Supported
DataGridâś… Supported
InteractionTagâś… Supported
SwatchPickerâś… Supported
TabListâś… Supported
TagPicker⚠️ Partial Support
TeachingPopover?
Toolbar?
Tree?

Usage

To import Hook:

import { useGamepadNavigationGroup } from '@fluentui-contrib/react-gamepad-navigation';

Examples

export const SampleApp = () => {
  // attributes for both: Gamepad and Arrow key navigation
  const { gamepadNavDOMAttributes } = useGamepadNavigationGroup();

  return <div {...gamepadNavDOMAttributes}></div>;
};

Options

The default configuration provides the closest behavior to a console navigation experience. However, All the configurations from useArrowNavigationGroup and useFocusableGroup hooks are available as part of the options for useGamepadNavigationGroup

Hook Options

axis

type axis: 'vertical' | 'horizontal' | 'grid' | 'grid-linear' | 'both';

Default: grid

Focus will navigate vertically, horizontally or in both directions (grid).

circular

type circular: boolean;

Default: false

Focus will cycle to the first/last elements of the group without stopping.

focusFirstElement

type focusFirstElement: boolean;

Default: false

First focusable element in the group will be focused when the group is focused for the first time.

memorizeCurrent

type memorizeCurrent: boolean;

Default: false

Last focused element in the group will be remembered and focused (if still available) when tabbing from outside of the group.

tabbable

type tabbable: boolean;

Default: true

Allow tabbing within the arrow navigation group items.

tabBehavior

type tabBehavior: 'unlimited' | 'limited' | 'limited-trap-focus';

Default: limited-trap-focus

Behavior for the Tab key.

ignoreDefaultKeydown

type ignoreDefaultKeydown: TabsterTypes.FocusableProps['ignoreKeydown'];

Default: {}

Tabster can ignore default handling of keydown events.

FAQs

Package last updated on 18 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts