npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@theforce/vue

v2.0.0

Published

Vue library for TheForce hand tracking

Downloads

10

Readme

@theforce/vue

Vue integration for TheForce Hand Tracking Library. This package provides useHandTracker composable and Hoverable component to easily integrate hand tracking into your Vue 3 applications.

Installation

npm install @theforce/vue @theforce/core
# or
yarn add @theforce/vue @theforce/core

Quick Start

<template>
  <div class="app">
    <h1>Hand Tracking Demo (Vue)</h1>
    <p>Status: {{ isTracking ? "Tracking" : "Stopped" }}</p>

    <Hoverable style="padding: 20px; border: 1px solid gray; margin-top: 20px;">
      Hover over me with your hand!
    </Hoverable>
  </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from "vue";
import { useHandTracker, Hoverable } from "@theforce/vue";

// Optional: Configure hoverDelay and sensitivity for the HandTracker instance
const config = {
  hoverDelay: 2000, // Time in milliseconds to hover before triggering a click
  sensitivityX: 1.5, // Multiplier for horizontal cursor movement sensitivity
  sensitivityY: 1.5, // Multiplier for vertical cursor movement sensitivity
  debug: true, // Set to true to display the camera feed in the bottom right corner for debugging
};

const { handLandmarks, isTracking, initialize, stop } = useHandTracker(config);

onMounted(async () => {
  // Initialize and start tracking when the component mounts
  await initialize();
});

onUnmounted(() => {
  // Cleanup on component unmount
  stop();
});
</script>

<style scoped>
.app {
  font-family: sans-serif;
  text-align: center;
  padding: 20px;
}
</style>

useHandTracker Composable

This composable provides access to the hand tracking state and control functions.

const { handLandmarks, isTracking, initialize, stop } = useHandTracker(config);

| Property | Type | Description | | --------------- | --------------------- | ---------------------------------------------------------------------------- | | handLandmarks | Array<any> | A reactive array of detected hand landmarks. Empty if no hands are detected. | | isTracking | boolean | A reactive boolean indicating if hand tracking is active. | | initialize | () => Promise<void> | Function to initialize and start hand tracking. | | stop | () => Promise<void> | Function to stop hand tracking and clean up resources. |

Hoverable Component

This component is a wrapper that automatically applies data-hoverable="true" to its content, making it interactive with the virtual cursor.

<Hoverable>
  <!-- Your content here -->
</Hoverable>

Configuration Options

The useHandTracker composable accepts an optional configuration object. These options are passed directly to the underlying @theforce/core HandTracker instance:

| Option | Type | Default | Description | | --------------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | hoverDelay | number | 2000 | Time in milliseconds to hover before triggering a click. | | sensitivityX | number | 1 | Multiplier for horizontal cursor movement sensitivity. Higher values make the cursor move faster horizontally. | | sensitivityY | number | 1 | Multiplier for vertical cursor movement sensitivity. Higher values make the cursor move faster vertically. | | cursorImageUrl | string | - | Optional URL for a custom image to be used as the virtual cursor. If not provided, a default red circle is used. | | cursorLandmarkIndex | number | 9 | The index of the landmark to use for cursor positioning (e.g., 0 for wrist, 8 for index finger tip, 9 for middle finger base). Defaults to 9 (middle finger base) for a more central hand tracking experience. | | debug | boolean | false | If true, the camera feed will be displayed in the bottom right corner for debugging purposes. |

Styling Hoverable Elements

Elements wrapped by Hoverable will have the following CSS classes applied by the core library, which you can style:

  • .force-hoverable: Always present on elements with data-hoverable="true".
  • .force-hover: Added when the virtual cursor is hovering over the element.

For the virtual cursor itself, you can style the .force-cursor and .force-loading classes. Refer to the @theforce/core documentation for more details.