interface TapHandlers {
    globalTapTarget?: boolean;
    whileTap?: VariantLabels | TargetAndTransition;
    onTap?(event, info): void;
    onTapCancel?(event, info): void;
    onTapStart?(event, info): void;
}

Hierarchy (view full)

Properties

globalTapTarget?: boolean

If true, the tap gesture will attach its start listener to window.

Note: This is not supported publically.

Properties or variant label to animate to while the component is pressed.

<motion.div whileTap={{ scale: 0.8 }} />

Methods

  • Callback when the tap gesture successfully ends on this element.

    function onTap(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onTap={onTap} />

    Parameters

    Returns void

  • Callback when the tap gesture ends outside this element.

    function onTapCancel(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onTapCancel={onTapCancel} />

    Parameters

    Returns void

  • Callback when the tap gesture starts on this element.

    function onTapStart(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onTapStart={onTapStart} />

    Parameters

    Returns void

Generated using TypeDoc