AddThisFeature

Pointer Modality Styles

Make hover, focus, and hit targets behave correctly for mouse, touch, pen, and keyboard.

moderate UI & Polish

What it adds

Input-aware styling and interaction rules so each pointer type gets the affordances it can actually use.

What your agent is told to do

5
  1. 1

    Audit the app for interactions that assume a mouse: hover-revealed row actions, tooltips that carry information available nowhere else, tiny icon buttons, and drag handles that only appear on hover.

  2. 2

    Gate hover styling on the device genuinely supporting hover, rather than on screen width. A touchscreen laptop is wide and cannot hover reliably; a stylus tablet is narrow and can.

  3. 3

    Raise the hit area for coarse pointers without changing the visual size of the control. The user should get a larger target, not a bigger-looking button that breaks the layout.

  4. 4

    Keep the focus indicator visible for anyone navigating by keyboard, and suppress it only for pointer-initiated focus. Removing focus rings outright to tidy up mouse interaction makes the app unusable without one.

  5. 5

    Do not resolve pointer type once at load and cache it for the session. Users plug in a mouse, pick up a pen, and switch to the keyboard mid-task, and a cached answer is wrong from that moment on.

Edge cases it handles

7
  • Hybrid devices have more than one pointer at once — a laptop with a touchscreen, a tablet with a keyboard and trackpad case — so any rule that treats input as a single fixed capability will be wrong for one of them. Style from the capability being used now, and let the coarse-pointer accommodations remain available even when a mouse is attached.
  • The keyboard focus indicator must never be hidden. It is the only way a keyboard user can tell where they are, and suppressing it to clean up mouse clicks removes the app's navigability rather than its clutter.
  • Any action available only on hover is unreachable on touch. Row actions, delete buttons, and drag handles revealed by hover need a persistent or explicitly summoned equivalent — a visible control, a long press, or an overflow menu — and hover may only be an accelerator on top of it.
  • Modality must be re-evaluated continuously during a session. A user who starts with touch and then attaches a keyboard should get focus rings from the next keypress, without reloading the page.
  • A single interaction can produce both touch and mouse events, so logic keyed to a pointer type must not fire twice or leave a control stuck in a hover state after a tap.
  • Tooltips that carry information found nowhere else are inaccessible to touch and to screen readers alike, so the underlying content must exist in the accessible name or visible copy, with the tooltip as a convenience.
  • A stylus is a fine pointer with no hover on some devices and hover on others, so it must not be lumped in with touch and given oversized targets it does not need.

Definition of done

8
  • Hover styling is applied only where the device actually supports hover, not inferred from viewport width.
  • No action exists that can be reached by hover alone.
  • Keyboard focus is always visible, and focus styling is suppressed only for pointer-initiated focus.
  • Coarse pointers get an enlarged hit area without a change in the control's visual size.
  • Switching input method mid-session changes the affordances without a reload.
  • A single tap produces one interaction, with no lingering hover state left behind.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.