@hapticjs/vue
v0.1.1
Published
Vue composables and directives for Feelback haptic engine
Downloads
28
Maintainers
Readme
@hapticjs/vue
Vue composables and directives for the @hapticjs haptic engine.
npm install @hapticjs/vue @hapticjs/coreUsage
Directive
<template>
<button v-haptic="'tap'">Click me</button>
<button v-haptic="'success'">Submit</button>
<button v-haptic="'~~..##'">Pattern</button>
</template>Composable
<script setup>
import { useHaptic } from '@hapticjs/vue';
const { trigger } = useHaptic('success');
const haptic = useHaptic();
</script>
<template>
<button @click="trigger">Submit</button>
<button @click="haptic.tap()">Tap</button>
</template>Plugin
import { createApp } from 'vue';
import { HapticPlugin } from '@hapticjs/vue';
createApp(App).use(HapticPlugin).mount('#app');License
MIT
