TapEvent
Where a tap landed, in the view and on screen.
Verwendung
Respond to a tap's coordinates.
// Respond to a tap's coordinates.
import { Box, motion, tap, timing, type TapEvent } from 'kuito';
function Ripple() {
const x = motion(0);
const y = motion(0);
const grow = motion(0);
// Start the ripple where the finger landed.
const startAt = (event: TapEvent) => {
x.value = event.x;
y.value = event.y;
grow.value = 0;
grow.value = timing(250).to(1);
};
return (
<Box gestures={[tap({ onEnd: startAt })]} width={200} height={56}>
<Box position="absolute" translateX={x} translateY={y} scale={grow} width={8} height={8} />
</Box>
);
}Typdeklaration
export type TapEvent = PositionEvent;Mitglieder 7
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
x | number | Ja | — |
y | number | Ja | — |
absoluteX | number | Ja | — |
absoluteY | number | Ja | — |
state | number | Ja | — |
numberOfPointers | number | Ja | — |
pointerType | number | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.