Skip to main content
Not yet stable
@foresightjs/vue is at 0.1.0 and not yet stable. It works and is fully tested, but the API may still change.
Version: 4.0

Installation

npm version npm downloads

@foresightjs/vue is the official Vue 3 package for ForesightJS. It ships the v-foresight directive for the common case, plus the useForesight, useForesights and useForesightEvent composables when you want the element's prediction state.

npm install @foresightjs/vue
# or
pnpm add @foresightjs/vue
# or
yarn add @foresightjs/vue

That's it. Everything you need, including ForesightManager and all types, comes from @foresightjs/vue — there's nothing else to install:

import { useForesight, vForesight, ForesightManager } from "@foresightjs/vue"

Configuring the manager

You don't have to configure anything. The manager auto-initializes with sensible defaults the first time you register an element.

If you want to tweak global behaviour, call ForesightManager.initialize() once in your main.ts. See Initialize the Manager and Global Settings.

Devtools

The visual Development Tools live in their own package (js.foresight-devtools) and work the same regardless of framework.