@foresightjs/vue
v1.0.0
Published
Vue composables for ForesightJS - register elements with the ForesightManager from Vue components.
Maintainers
Readme
@foresightjs/vue
Official Vue 3 bindings for ForesightJS, a lightweight library that predicts user intent (mouse trajectory, keyboard navigation, scroll, touch) to trigger callbacks like prefetching before the user interacts.
- Docs: foresightjs.com/docs/vue/installation
- Core library:
js.foresight - Playground: foresightjs.com
Installation
pnpm add @foresightjs/vue js.foresight
# or
npm install @foresightjs/vue js.foresightRequires Vue 3.5+
What's included
v-foresight-> directive to register an element with a callback or full options objectuseForesight-> register a single element and get reactive refs for its stateForesight-> component form of useForesight with a scoped slotuseForesightEvent-> subscribe to a ForesightManager event for the lifetime of the calling scope
For usage and examples, see the Vue documentation.
Contributing
Please see the contributing guidelines.
