Verwendung

Add haptic feedback to a gesture.

tsx
// Add haptic feedback to a gesture.
import { Box, haptics, pan, type Callbacks, type PanChangeEvent, type PanEvent } from 'kuito';

// Shared feedback for every draggable in the app.
const feedback: Callbacks<PanEvent, PanChangeEvent> = {
  onStart: () => void haptics.selection(),
  onEnd: (_, success) => void (success && haptics.impact('light')),
};

<Box gestures={[pan({ axis: 'x', ...feedback })]} />;

Signaturen

ts
(): Promise<void>

Parameter

Keine Parameter.

Rückgabe

Promise<void>

Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.