IsUsingKeyboard

Utilities
Local guide ↗

Live input modality

Observe the shared document-level state switch between keyboard and pointer input

Pointer modality

A pointer move or pointerdown was detected.

Try Tab or an arrow key, then move the pointer across the demo. The indicator follows the last input modality anywhere in the document.

IsUsingKeyboard.current becomes true after a document keydown, then false after pointerdown or pointermove. It describes the latest input modality, not whether an element merely has focus.

Instances share one global reactive state and reference-counted document listeners, so components can observe modality without each registering duplicate handlers. Bits UI uses this signal for keyboard accessibility behavior; applications can also use it to avoid pointer-only focus decoration.