TouchesOptions
Sets a touches() gesture's callbacks, and when and where it takes touches.
Usage
Track raw touch movement over a drawing surface.
This type is used by touches
// Track raw touch movement over a drawing surface.
import { Box, touches } from 'kuito';
export function TouchSurface() {
const input = touches({ onChange: (event) => console.log(event.changeX, event.changeY) });
return <Box gestures={[input]} width={240} height={240} backgroundColor="#e2e8f0" />;
}Type declaration
export type TouchesOptions = Common & Callbacks<PanEvent, PanChangeEvent>;Members 5
| Name | Type | Required | Description |
|---|---|---|---|
disabled | boolean | No | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | No | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: PanEvent) => void | No | It activated. |
onChange | (event: PanChangeEvent) => void | No | It moved, with the change since the last move. |
onEnd | (event: PanEvent, success: boolean) => void | No | It ended after activating: success is false when it was cancelled. |
onStart — method signatures
Signatures
onChange — method signatures
Signatures
(event: PanChangeEvent): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PanChangeEvent | Yes | — |
Returns
void
onEnd — method signatures
Signatures
(event: PanEvent, success: boolean): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PanEvent | Yes | — |
success | boolean | Yes | — |
Returns
void
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.