Usage

Track raw touch movement over a drawing surface.

This type is used by touches

tsx
// 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

ts
export type TouchesOptions = Common & Callbacks<PanEvent, PanChangeEvent>;

Members 5

NameTypeRequiredDescription
disabledbooleanNoIgnores touches, like a disabled Pressable.
hitAreaHitAreaNoInsets of the area that takes touches: one for every edge, or by edge.
onStart(event: PanEvent) => voidNoIt activated.
onChange(event: PanChangeEvent) => voidNoIt moved, with the change since the last move.
onEnd(event: PanEvent, success: boolean) => voidNoIt ended after activating: success is false when it was cancelled.
onStart — method signatures

Signatures

ts
(event: PanEvent): void

Parameters

NameTypeRequiredDescription
eventPanEventYes—

Returns

void

onChange — method signatures

Signatures

ts
(event: PanChangeEvent): void

Parameters

NameTypeRequiredDescription
eventPanChangeEventYes—

Returns

void

onEnd — method signatures

Signatures

ts
(event: PanEvent, success: boolean): void

Parameters

NameTypeRequiredDescription
eventPanEventYes—
successbooleanYes—

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.