Skip to content

API overview

Quick reference for all public exports from @diffgazer/keys.

Quick map of the main public exports from @diffgazer/keys. Requires React >=19.2.0.

Info:

See the interactive playground for live demos of each hook.


Provider

ExportDescription
KeyboardProviderContext provider that enables scoped keyboard handling. Wraps your app or subtree.

Hooks

HookCategoryDescription
useKeyProviderBind keyboard shortcuts with scoped, document-level, or container-scoped listening.
useScopeProviderPush a named scope onto the keyboard scope stack.
useNavigationStandaloneStandalone keyboard navigation for role-based lists and tabs.
useScopedNavigationProviderScope-aware keyboard navigation registered via KeyboardProvider.
useActionRowNavigationProviderTwo-zone keyboard navigation for rows with inline actions.
useFocusZoneProviderManage focus across multiple zones with arrow key and Tab transitions.
useFocusTrapStandaloneTrap Tab focus within a container element.
useFocusRestoreStandaloneCapture and restore focus around temporary UI with nested stack safety.
useScrollLockStandalonePrevent body/element scrolling with reference counting.

References

PageDescription
Hotkey FormatModifier syntax, key aliases, and matching rules for hotkey strings.
UtilitiesHelper functions: navigation item utilities, focus restore utilities, keys, useKeyboardContext, and useOptionalKeyboardContext.
TypesShared TypeScript interfaces and type definitions.