Skip to content

Conversation

@localhostd3veloper
Copy link

@localhostd3veloper localhostd3veloper commented Oct 28, 2025

Add usePointerFine Hook

Adds the usePointerFine() hook that detects whether the user's primary input mechanism is a fine-grained pointer device (mouse, stylus, or touchpad).

Features

  • Detects fine pointer devices using CSS media query (pointer: fine)
  • Updates on device orientation and resize changes
  • SSR-safe (handles undefined window)
  • Automatically cleans up event listeners

Use Cases

  • Adapt hover interactions based on device capabilities
  • Show/hide precision controls based on input method
  • Adjust UI layouts for touch vs mouse input

Implementation

Uses the native matchMedia API to detect pointer capabilities and listens for change, resize, and orientationchange events.

Screenshots

Fine Pointer
image

Coarse Pointer (else)
image

Resolves #100

@localhostd3veloper localhostd3veloper changed the title [FEAT]: usePointerFine( ) Hook [FEAT]: usePointerFine() Hook Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add usePointerFine Hook

1 participant