Interaction details

Where does focus go when the dialog closes? Can you hit that icon on a phone?

Focus management: trap and restore

Dialog opens: tab cycles within the overlay. Dialog closes: focus returns to the trigger.

Native <dialog> handles trapping. Radix, Aria, Headless UI handle trapping and restoration.

Other focus moments:

Hit targets: 24px desktop, 44px mobile

These are hit area, not visual size. A 16px icon can have a 44px tap target:

Adjacent targets need 8px minimum between hit areas.

Hover gates

Touch devices fire hover on tap. Gate hover behind a media query:

Use :active for press feedback and :focus-visible for keyboard.

touch-action for gestures

Common mistakes