@neshel-ui/animations/gestures
Every export of @neshel-ui/animations/gestures, generated from its declarations.
Experimental and not on npm
Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.
ElasticScrollcomponentA package-rendered scroll container whose content stretches visually at its edges (decorative).
(props: ElasticScrollProps): ElementGesturecomponent`<Gesture>`: physics & gesture effects on a `<div>` or, with `asChild`, your own element.
<Options, Resolved>(props: GestureProps<Options, Resolved>): ElementPinchZoomcomponentPinch-zoom media with zoom buttons and keys (WCAG 2.5.1); one-finger page scrolling kept at scale 1.
(props: PinchZoomProps): ElementPullToRefreshcomponentAn optional pull-to-refresh indicator on a package-rendered scroll container, plus an explicit refresh button. Never blocks scrolling or the browser's own behaviour (research R3).
(props: PullToRefreshProps): ElementReordercomponentDrag-to-reorder list. The order is yours: `onReorder(from, to)` asks you to move an item; React re-renders and the items settle from where they are shown (no DOM reordering by the package, no lost state).
(props: ReorderProps): ElementReorderHandlecomponentThe drag handle and keyboard control of an item (a real button; touch drags start here).
(props: ReorderHandleProps): ElementReorderItemcomponent(props: ReorderItemProps): ElementSwipeDismisscomponentSwipe to dismiss with a built-in, accessible dismiss button (WCAG 2.5.7).
(props: SwipeDismissProps): ElementcreateGesturefunction(element: HTMLElement, initial: GestureOptions): GestureHandlecreateGestureControlsfunctionCreate a controls object (one per controlled element; stable for its lifetime).
(): GestureControlscreateVelocityTrackerfunctionRelease-velocity estimate from the samples of the last `windowMs` (default 100): slope between the oldest sample in the window and the newest, minimum span 8 ms (research R4). Ring buffer, no allocation per add.
(windowMs?: number | undefined): VelocityTrackergetGestureDebugInfofunction(): GestureDebugInfonearestSnapfunctionThe point of `points` nearest to `value` (`value` itself when the list is empty).
(value: number, points: readonly number[]): numberprojectDecayfunctionRest position of an exponential decay started from `value` with release `velocity` (px/s): `value + power · velocity · τ` (research R5). Lets snap points be chosen before animating.
(value: number, velocity: number, options?: DecayOptions | undefined): numberreorderMovefunctionMove `item` of a list with an attached `reorder` effect by `step` positions (move up/down buttons): asks the consumer through `onReorder`, announces the result and settles the items. No-op without the effect.
(list: Element, item: HTMLElement, step: number): voidrubberbandfunctionRubber band: displacement `overshoot` beyond a bound, over `dimension` px, maps to `(1 − 1 / (|x|·c/d + 1)) · d` with the sign of `overshoot` (research R6). Continuous at 0, monotonic, asymptotic to `dimension`.
(overshoot: number, dimension: number, constant?: number | undefined): numberstepDecayfunctionAdvance a decay by `dt` seconds with the exact exponential solution (frame-rate independent). The state's velocity is the CURRENT velocity (start it at `power · releaseVelocity`). Returns `true` at rest, where the value lands on its exact projected end.
(state: DecayState, options: DecayOptions, dt: number): booleanuseGestureControlsfunctionA stable controls object for buttons and commands (the non-gesture alternatives).
(): GestureControlsuseReorderItemfunctionMove-up / move-down helpers for custom controls inside a `<ReorderItem>` (WCAG 2.5.7).
(): { moveUp: () => void; moveDown: () => void; index: number | undefined; count: number; isFirst: boolean; isLast: boolean; }useSpringFollowfunctionG05 as a hook: a motion value that chases `source` with a spring (no React render per change). Reduced motion jumps.
(source: MotionValue, spring?: SpringOptions | "gentle" | "snappy" | "bouncy" | undefined, reducedMotion?: ReducedMotion | undefined): MotionValuedragconstReadonly<EffectDefinition<DragOptions, ResolvedDrag>>dragSnapconstReadonly<EffectDefinition<DragSnapOptions, ResolvedDrag>>elasticEdgeconstReadonly<EffectDefinition<ElasticEdgeOptions, ResolvedElastic>>flingconstReadonly<EffectDefinition<FlingOptions, ResolvedDrag>>gestureEffectsconstEvery physics & gesture definition in catalogue order (G01–G11), for explicit registries.
readonly AnyEffectDefinition[]pinchZoomconstReadonly<EffectDefinition<PinchZoomOptions, ResolvedPinch>>pullToRefreshconstReadonly<EffectDefinition<PullToRefreshOptions, ResolvedPull>>reorderconstReadonly<EffectDefinition<ReorderOptions, ResolvedReorder>>rotateGestureconstReadonly<EffectDefinition<RotateGestureOptions, ResolvedRotate>>springFollowconstReadonly<EffectDefinition<SpringFollowOptions, ResolvedFollow>>squashStretchconstReadonly<EffectDefinition<SquashStretchOptions, ResolvedSquash>>swipeDismissconstReadonly<EffectDefinition<SwipeDismissOptions, ResolvedSwipe>>DecayOptionsinterfaceDecayOptions
Physics primitives (Phase 012; contracts/gesture-engine.md §5, research R4–R6). Pure functions and a small velocity tracker: no scheduler, no DOM. Springs are NOT here — gestures use the 009 integrator (
stepSpring) through the 010 spring rig, so there is still one spring integrator.DecayOptions Prop Type Default Description power number— Fraction of the release velocity carried into the motion (0–1, default 0.8). restSpeed number5Speed below which the motion rests, px/s (default 5). timeConstant number— Time constant τ in ms (50–2000, default 325). DecayStateinterfaceDecayState
DecayState Prop Type Default Description value(required) number— — velocity(required) number— — DragOptionsinterfaceDragOptions
G01 — Drag with inertia.
DragOptions Prop Type Default Description axis GestureAxis"both"Movement axis (default "both").constraints Constraints— Limits of the movement: "parent", an element, or px from the rest position.controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).decay DecayOptions— Decay of the inertia ( power0–1,timeConstant50–2000 ms).disabled boolean— Turn the gesture off (disabled elements never react either). elastic number— Rubber band beyond the constraints while dragging (0 hard … 1, default 0.35). inertia booleantrueKeep moving after release with exponential decay (default true). keyboardStep number— px per arrow key (1–200, default 10; Shift × 5). Requires a focusable element. onEnd (position: Point) => void— Called when the element comes to rest after a drag, a key or a command. onStart () => void— — pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.spring SpringOptions | SpringPreset"snappy"Spring used for bounces and keyboard moves (default "snappy"-like 300/30).threshold number— px of movement before the gesture starts (0–40, default 3). DragSnapOptionsinterfaceDragSnapOptions
G02 — Drag constraints + snap points.
DragSnapOptions Prop Type Default Description axis GestureAxis"both"Movement axis (default "both").constraints Constraints— Limits of the movement: "parent", an element, or px from the rest position.controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).decay DecayOptions— Decay of the inertia ( power0–1,timeConstant50–2000 ms).disabled boolean— Turn the gesture off (disabled elements never react either). elastic number— Rubber band beyond the constraints while dragging (0 hard … 1, default 0.35). keyboardStep number— px per arrow key (1–200, default 10; Shift × 5). Requires a focusable element. onEnd (position: Point) => void— Called when the element comes to rest after a drag, a key or a command. onSnap (point: Point, index: number) => void— Called at rest with the snap point and its index (-1 for grid points). onStart () => void— — pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.snap readonly Partial<Point>[] | { grid: Partial<Point>; }— Snap points (px from the rest position) or a grid (default: the rest position only). spring SpringOptions | SpringPreset"snappy"Spring used for bounces and keyboard moves (default "snappy"-like 300/30).threshold number— px of movement before the gesture starts (0–40, default 3). ElasticEdgeOptionsinterfaceElasticEdgeOptions
G06 — Elastic edge (visual overscroll, decorative).
ElasticEdgeOptions Prop Type Default Description axis "x" | "y""y"Scroll axis of the container (default "y").disabled boolean— — max number— Maximum visual stretch in px (8–200, default 64). reducedMotion ReducedMotion"user"Decorative: reduced motion turns it off (default "user").ElasticScrollPropsinterfaceElasticScrollProps
ElasticScrollProps Prop Type Default Description axis "x" | "y""y"Scroll axis of the container (default "y").children ReactNode— — disabled boolean— — label string"Scrollable content"Accessible name of the scrollable region (default "Scrollable content"). max number— Maximum visual stretch in px (8–200, default 64). reducedMotion ReducedMotion"user"Decorative: reduced motion turns it off (default "user").ref Ref<HTMLElement>— — Also accepts the props of: React DOM attributes.
FlingOptionsinterfaceFlingOptions
G07 — Throw / fling with decay.
FlingOptions Prop Type Default Description axis GestureAxis"both"Movement axis (default "both").bounce number— Energy kept when bouncing off a constraint (0–1, default 0.5). constraints Constraints— Limits of the movement: "parent", an element, or px from the rest position.controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).decay DecayOptions— Decay of the inertia ( power0–1,timeConstant50–2000 ms).disabled boolean— Turn the gesture off (disabled elements never react either). elastic number— Rubber band beyond the constraints while dragging (0 hard … 1, default 0.35). keyboardStep number— px per arrow key (1–200, default 10; Shift × 5). Requires a focusable element. onRest (position: Point) => void— Called when the thrown element comes to rest. onStart () => void— — pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.spring SpringOptions | SpringPreset"snappy"Spring used for bounces and keyboard moves (default "snappy"-like 300/30).threshold number— px of movement before the gesture starts (0–40, default 3). GestureCommonOptionsinterfaceGestureCommonOptions
Options shared by every gesture effect.
GestureCommonOptions Prop Type Default Description controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).disabled boolean— Turn the gesture off (disabled elements never react either). pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.threshold number— px of movement before the gesture starts (0–40, default 3). GestureControlsinterfaceGestureControls
GestureControls Prop Type Default Description dismiss(required) () => void— — moveBy(required) (dx: number, dy: number) => void— — moveTo(required) (x: number, y: number) => void— — refresh(required) () => void— — reset(required) () => void— — rotateBy(required) (degrees: number) => void— — snapTo(required) (index: number) => void— — zoomBy(required) (factor: number) => void— — zoomTo(required) (scale: number) => void— — GestureDebugInfointerfaceGestureDebugInfo
GestureDebugInfo Prop Type Default Description claims(required) number— Pointers currently claimed by an active exclusive gesture. sessions(required) number— Pointer sessions alive (one per element with an attached gesture). GestureHandleinterfaceGestureHandle
GestureHandle Prop Type Default Description cancel(required) () => void— Abort the current gesture ( onCancelwhen active); its pointers are ignored until released.destroy(required) () => void— — phase(required) GesturePhase— — session(required) PointerSession— — setOptions(required) (options: GestureOptions) => void— Replace options (live); touchActionchanges apply at once.GestureOptionsinterfaceGestureOptions
GestureOptions Prop Type Default Description accept (event: PointerEvent | undefined, pointer: SessionPointer) => boolean— Call before activation to veto it (e.g. a handle-only reorder). axis GestureAxis"both"Required direction before activation (default "both"): a vertical swipe never starts an x drag.exclusive booleantrueExclusive gestures never share a pointer with another exclusive gesture (default true). onCancel (state: GestureState) => void— — onEnd (state: GestureState) => void— — onMove (state: GestureState) => void— — onPress (state: GestureState) => void— — onStart (state: GestureState) => void— — onTap (state: GestureState) => void— Released while still pending (no movement beyond the threshold). pointerTypes readonly string[]— — pointers 1 | 2— 1 = drag-like (default); 2 = transform gesture (also follows its 1-pointer phase). threshold number— px before activation (default 3; 0 = on press). Two pointers activate a transform gesture at once. touchAction readonly TouchToken[]— Touch gestures left to the browser on this element ( touch-actioncontribution).GestureStateinterfaceGestureState
GestureState Prop Type Default Description acceleration(required) Vec— px/s² (diagnostic). delta(required) Vec— Movement since the previous callback. event(required) PointerEvent | undefined— — offset(required) Vec— Movement since the gesture started, including scroll compensation (px, client axes). origin(required) Vec— Centroid of the active pointers (client coordinates). pointerType(required) string— — pointers(required) number— — rotation(required) number— Two pointers: angle change in degrees since start (accumulated); 0 otherwise. scale(required) number— Two pointers: distance ratio since start (accumulated across re-bases); 1 otherwise. velocity(required) Vec— px/s (research R4). PinchZoomOptionsinterfacePinchZoomOptions
G08 — Pinch-zoom media.
PinchZoomOptions Prop Type Default Description controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).disabled boolean— Turn the gesture off (disabled elements never react either). doubleTapScale number— Scale of a double tap / double click (1–10, default 2; 1 disables). maxScale number— Maximum scale (1–10, default 4). minScale number— Minimum scale (0.5–1, default 1). onZoomChange (scale: number) => void— Called with the scale after a gesture, a key or a command. pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.spring SpringOptions | SpringPreset— — step number— Factor of the zoom keys and buttons (1.1–4, default 1.5). threshold number— px of movement before the gesture starts (0–40, default 3). wheel boolean— Ctrl/⌘ + wheel and trackpad pinch zoom over the frame (opt-in; prevents the page zoom there). PinchZoomPropsinterfacePinchZoomProps
PinchZoomProps Prop Type Default Description children(required) ReactElement— Exactly one media element (img, video, canvas, picture, …). controlLabels { zoomIn?: string; zoomOut?: string; reset?: string; }— Button labels (defaults "Zoom in", "Zoom out", "Reset zoom"). controls GestureControls— — disabled boolean— Turn the gesture off (disabled elements never react either). doubleTapScale number— Scale of a double tap / double click (1–10, default 2; 1 disables). label string"Zoomable media"Accessible name of the zoomable region (default "Zoomable media"). maxScale number— Maximum scale (1–10, default 4). minScale number— Minimum scale (0.5–1, default 1). onZoomChange (scale: number) => void— Called with the scale after a gesture, a key or a command. pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.ref Ref<HTMLDivElement>— — spring SpringOptions | SpringPreset— — step number— Factor of the zoom keys and buttons (1.1–4, default 1.5). threshold number— px of movement before the gesture starts (0–40, default 3). wheel boolean— Ctrl/⌘ + wheel and trackpad pinch zoom over the frame (opt-in; prevents the page zoom there). zoomControls booleantrueRender the zoom buttons (default true). Also accepts the props of: React DOM attributes.
PointinterfacePoint
Point Prop Type Default Description x(required) number— — y(required) number— — PullToRefreshOptionsinterfacePullToRefreshOptions
G04 — Pull-to-refresh indicator.
PullToRefreshOptions Prop Type Default Description controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).disabled boolean— Turn the gesture off (disabled elements never react either). onRefresh () => unknown— The refresh action (provided by the consumer); a returned promise keeps the busy state until it settles. onStatus (status: "refreshing" | "done") => void— Called with "refreshing"and"done"(announcements;<PullToRefresh>announces them).pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.threshold number— Pull distance (px) that triggers a refresh on release (24–240, default 72). PullToRefreshPropsinterfacePullToRefreshProps
PullToRefreshProps Prop Type Default Description children ReactNode— — controls GestureControls— — disabled boolean— Turn the gesture off (disabled elements never react either). onRefresh () => unknown— The refresh action (provided by the consumer); a returned promise keeps the busy state until it settles. pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.ref Ref<HTMLDivElement>— — refreshButton booleantrueRender the built-in refresh button (default true). refreshLabel string"Refresh"Label of the built-in refresh button (default "Refresh"). scrollerLabel string"Scrollable content"Accessible name of the scrollable region (default "Scrollable content"). statusLabels { refreshing?: string; done?: string; }— Announcements (default "Refreshing…" / "Content updated"). threshold number— Pull distance (px) that triggers a refresh on release (24–240, default 72). Also accepts the props of: React DOM attributes.
ReorderAnnouncementsinterfaceReorderAnnouncements
ReorderAnnouncements Prop Type Default Description cancel(required) (label: string, position: number, count: number) => string— — drop(required) (label: string, position: number, count: number) => string— — grab(required) (label: string, position: number, count: number) => string— — move(required) (label: string, position: number, count: number) => string— — ReorderHandlePropsinterfaceReorderHandleProps
ReorderHandleProps Prop Type Default Description aria-label string"Reorder <label>"Accessible name (default "Reorder <label>"). children ReactNode— — ref Ref<HTMLButtonElement>— — Also accepts the props of: React DOM attributes.
ReorderItemPropsinterfaceReorderItemProps
ReorderItemProps Prop Type Default Description as "li" | "div""li"Item element (default "li").children ReactNode— — index number— Position of the item in your order (enables useReorderItem().isFirst/isLast).label string— Name used in announcements (default: the item's text). ref Ref<HTMLElement>— — Also accepts the props of: React DOM attributes.
ReorderOptionsinterfaceReorderOptions
ReorderOptions Prop Type Default Description announce (message: string) => void— Announce a message (default: a shared polite live region; <Reorder>passes its own).announcements Partial<ReorderAnnouncements>— Override the English announcements. axis "x" | "y""y"List direction (default "y").disabled boolean— — onReorder (from: number, to: number) => void— Move the item at fromtotoin the consumer's order (required for the list to change).pointerTypes readonly PointerKind[]— Pointer kinds that may drag (default mouse, pen and touch; touch always needs a handle). reducedMotion ReducedMotion"user"Reduced motion: shifts and settling jump (default "user").spring SpringOptions | SpringPreset— Spring of shifts and settling (default 420/36). ReorderPropsinterfaceReorderProps
ReorderProps Prop Type Default Description announcements Partial<ReorderAnnouncements>— Override the English announcements. as "ul" | "ol" | "div""ul"List element (default "ul").axis "x" | "y""y"List direction (default "y").children ReactNode— — disabled boolean— — instructions string— Keyboard instructions read with each handle (default English). onReorder (from: number, to: number) => void— Move the item at fromtotoin the consumer's order (required for the list to change).pointerTypes readonly PointerKind[]— Pointer kinds that may drag (default mouse, pen and touch; touch always needs a handle). reducedMotion ReducedMotion"user"Reduced motion: shifts and settling jump (default "user").ref Ref<HTMLElement>— — spring SpringOptions | SpringPreset— Spring of shifts and settling (default 420/36). Also accepts the props of: React DOM attributes.
RotateGestureOptionsinterfaceRotateGestureOptions
G09 — Rotate gesture.
RotateGestureOptions Prop Type Default Description controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).disabled boolean— Turn the gesture off (disabled elements never react either). keyStep numberrotateByDegrees per [/]key and defaultrotateBybutton step (1–90, default 15).onRotateEnd (degrees: number) => void— Called with the rotation (degrees) after a gesture, a key or a command. pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.spring SpringOptions | SpringPreset— — step number— Snap the rotation to multiples of stepdegrees on release (0 = free, default 0).threshold number— px of movement before the gesture starts (0–40, default 3). SpringFollowOptionsinterfaceSpringFollowOptions
G05 — Spring follow (value chasing).
SpringFollowOptions Prop Type Default Description reducedMotion ReducedMotion"user"Reduced motion jumps to the value (default "user").rotate MotionValue— Rotation to chase (degrees). scale MotionValue— Scale factor to chase. spring SpringOptions | SpringPreset"gentle"Spring (default "gentle"-like 120/18).x MotionValue— Horizontal translation to chase (px). y MotionValue— Vertical translation to chase (px). SquashStretchOptionsinterfaceSquashStretchOptions
G11 — Velocity squash & stretch (decorative).
SquashStretchOptions Prop Type Default Description intensity number— Strength (0–1, default 0.25); the deformation never exceeds 25 %. reducedMotion ReducedMotion"user"Decorative: reduced motion turns it off (default "user").spring SpringOptions | SpringPreset— Spring of the deformation (default 400/24). SwipeDismissOptionsinterfaceSwipeDismissOptions
SwipeDismissOptions Prop Type Default Description controls GestureControls— Non-gesture alternatives ( createGestureControls()/useGestureControls()).direction SwipeDirection"x"Allowed direction(s) (default "x": left or right).disabled boolean— Turn the gesture off (disabled elements never react either). distance number— Fraction of the element's size that dismisses on release (0.1–1, default 0.5). keyboard booleantrueDelete / Backspace dismiss when the element is focused (default true). onDismiss (direction: "left" | "right" | "up" | "down") => void— Called once when the element has left; the consumer removes it. pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.threshold number— px of movement before the gesture starts (0–40, default 3). velocity number— Release speed that dismisses, px/s (100–5000, default 800). SwipeDismissPropsinterfaceSwipeDismissProps
SwipeDismissProps Prop Type Default Description children ReactNode— — controls GestureControls— — direction SwipeDirection"x"Allowed direction(s) (default "x": left or right).disabled boolean— Turn the gesture off (disabled elements never react either). dismissButton booleantrueRender the built-in dismiss button (default true). Provide your own accessible control when false. dismissLabel string"Dismiss"Accessible name of the built-in dismiss button (default "Dismiss"). distance number— Fraction of the element's size that dismisses on release (0.1–1, default 0.5). keyboard booleantrueDelete / Backspace dismiss when the element is focused (default true). onDismiss (direction: "left" | "right" | "up" | "down") => void— Called once when the element has left; the consumer removes it. pointerTypes readonly PointerKind[]— Pointer kinds that may start the gesture (default mouse, pen and touch). reducedMotion ReducedMotion"user"Reduced-motion policy (default "user"): automatic motion jumps to its end; direct manipulation stays.ref Ref<HTMLDivElement>— — threshold number— px of movement before the gesture starts (0–40, default 3). velocity number— Release speed that dismisses, px/s (100–5000, default 800). Also accepts the props of: React DOM attributes.
VelocityTrackerinterfaceVelocityTracker
VelocityTracker Prop Type Default Description acceleration(required) () => { x: number; y: number; }— Change of velocity between the last two estimates, px/s² (diagnostic). add(required) (time: number, x: number, y: number) => void— Add a sample ( timein ms).reset(required) () => void— — velocity(required) (time?: number) => { x: number; y: number; }— Velocity in px/s at time(ms); 0 when the last sample is older than 40 ms (the pointer stopped).Constraintstype"parent" | Element | { left?: number; right?: number; top?: number; bottom?: number; }GestureAxistype"x" | "y" | "both"GesturePhasetype"idle" | "pending" | "active"GesturePropstypeGestureProps
GestureProps Prop Type Default Description asChild boolean— Apply the effects to the single child element instead of rendering a <div>.children ReactNode— — conflicts ConflictPolicy— Conflict reporting for exclusive channels (default: warn in development). options undefined | NoInfer<Partial<Options>>— — preset(required) readonly PresetInput<any, any>[] | PresetInput<Options, Resolved>— — ref Ref<HTMLDivElement>— — Also accepts the props of: React DOM attributes.
PointerKindtype"mouse" | "pen" | "touch"SwipeDirectiontypeG03 — Swipe to dismiss.
"x" | "left" | "right" | "y" | "up" | "down"