A callback that receives the tap location as a
Point ({ x, y }) in the component’s coordinate space.Configuration options for the tap gesture.
Support
Usage
Single tap
Simple tap action (ignoring location)
Double tap
Combining single and double tap
Notes
- The
locationInViewis in the tapped component’s local coordinate space, with{ x: 0, y: 0 }at the top-leading corner. - When combining single and multi-tap gestures, apply the higher count gesture first. The system waits briefly to distinguish between single and multi-tap.
- For interactive controls like buttons, prefer using
Buttondirectly..onTapGesture()is best for adding tap handling to non-interactive components.
See Also
- onDragGesture — tracks drag gestures
- onLongPressGesture — detects long press gestures
- onHover — detects hover events