TapTickit Docs

Hooks & composables

Framework entry points wrap a single TapticKit instance.

React — useTaptic

import { useTaptic } from "taptickit/react";

function useTaptic(options?: TapticKitOptions): {
  trigger: (input?: HapticInput, options?: TriggerOptions) => Promise<void> | undefined;
  cancel: () => void;
  isSupported: boolean;
};
  • Instance is created in useEffect and destroy() runs on unmount.
  • debug and showSwitch update when the option values change.

Vue — useTaptic

import { useTaptic } from "taptickit/vue";

Same return shape as React. Instance is created in onMounted, destroyed in onUnmounted. Only debug is watched after mount.

Svelte — createTaptic

import { createTaptic } from "taptickit/svelte";

function createTaptic(options?: TapticKitOptions): {
  trigger: (input?: HapticInput, options?: TriggerOptions) => Promise<void>;
  cancel: () => void;
  destroy: () => void;
  setDebug: (debug: boolean) => void;
  isSupported: boolean;
};

You are responsible for calling destroy() when the UI that owns the instance goes away (for example onDestroy in Svelte 4).