PinchOptions
Sets a pinch() gesture's callbacks, and when and where it takes touches.
Usage
Apply a pinch's change in scale.
This type is used by pinch
// Apply a pinch's change in scale.
import { Text, pinch, signal, type PinchChangeEvent } from 'kuito';
const fontSize = signal(17);
// Text size follows the pinch, between 12 and 34 points.
const resize = (event: PinchChangeEvent) => {
fontSize.value = Math.min(34, Math.max(12, fontSize.value * event.scaleChange));
};
<Text fontSize={fontSize.value} gestures={[pinch({ onChange: resize })]}>
Pinch to resize
</Text>;Type declaration
export type PinchOptions = Common & Callbacks<PinchEvent, PinchChangeEvent>;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: PinchEvent) => void | No | It activated. |
onChange | (event: PinchChangeEvent) => void | No | It moved, with the change since the last move. |
onEnd | (event: PinchEvent, success: boolean) => void | No | It ended after activating: success is false when it was cancelled. |
onStart — method signatures
Signatures
onChange — method signatures
Signatures
(event: PinchChangeEvent): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PinchChangeEvent | Yes | — |
Returns
void
onEnd — method signatures
Signatures
(event: PinchEvent, success: boolean): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PinchEvent | 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.