Import useTaptic from taptickit/vue. The composable creates a TapticKit on mount and destroys it on unmount.
<script setup lang="ts">
import { useTaptic } from "taptickit/vue";
const { trigger, cancel, isSupported } = useTaptic();
</script>
<template>
<button type="button" @click="trigger('heavy')">Heavy tap</button>
</template>
useTaptic(options?) accepts TapticKitOptions:
debug — Desktop-style audio / timing feedback.showSwitch — Shows the built-in DOM control.The initial options object is passed into the TapticKit constructor on mount. Changes to debug are watched and applied via setDebug. Other fields (such as showSwitch) are not re-read after mount unless you remount the component.
| Property | Type | Description |
|---|---|---|
trigger | (input?, options?) => Promise<void> | undefined | TapticKit.trigger |
cancel | () => void | TapticKit.cancel |
isSupported | boolean | TapticKit.isSupported |