Overview
The tap gesture (also called press gesture) detects pointer press interactions. It provides event callbacks for tap start, end, and cancel, as well as animation states.Props
whileTap
Properties or variant label to animate to while the component is pressed.Event Handlers
onTap
Callback when the tap gesture successfully ends on this element.onTapStart
Callback when the tap gesture starts on this element.onTapCancel
Callback when the tap gesture ends outside this element.Advanced Props
globalTapTarget
Iftrue, the tap gesture will attach its start listener to window.
propagate.tap
Control whether tap gesture events propagate to parent motion components.Examples
Button with tap feedback
Interactive card
Tap with haptic feedback
Notes
- Disabled buttons automatically ignore tap gestures
- The tap gesture fires
onTaponly when the pointer is released while still over the element - If the pointer moves off the element before release,
onTapCancelfires instead