Interaction & Movement

Force Dot

Interactive particle system with physics-based animations.

The ForceDot component creates an interactive particle system with physics-based animations. Dots respond to mouse movement with attraction or repulsion forces, creating dynamic visual effects.

Usage

Force Dot

Interactive physics-based dot that responds to cursor movements with realistic force simulations

<template>
  <div class="flex flex-col items-center p-8">
    <div class="text-center mb-8">
      <h3 class="text-2xl font-bold mb-3 text-highlighted">
        Force Dot
      </h3>
      <p class="text-muted max-w-md">
        Interactive physics-based dot that responds to cursor movements with realistic force simulations
      </p>
    </div>

    <div class="relative h-64 w-64 rounded-xl overflow-hidden border bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-gray-800 dark:to-gray-900">
      <MForceDot class="w-full h-full" />
    </div>

    <div class="mt-6 flex gap-3">
      <UButton
        color="primary"
        variant="solid"
        size="sm"
      >
        <UIcon
          name="i-lucide-play"
          class="w-4 h-4 mr-2"
        />
        Start Simulation
      </UButton>
      <UButton
        color="gray"
        variant="outline"
        size="sm"
      >
        <UIcon
          name="i-lucide-rotate-ccw"
          class="w-4 h-4 mr-2"
        />
        Reset
      </UButton>
    </div>
  </div>
</template>

Examples

With Custom Count and Size

<template>
  <MForceDot
    :count="50"
    :width="400"
    :height="400"
  />
</template>

Customize

Customize

Count80
Width600
Height600
Radius12
Repel
Attract
Influence Radius250
Max Force3
Speed1
Dot Classfill-neutral-200

Props

Prop Type Default Description
countnumber80Number of dots.
widthnumber600Width of the container.
heightnumber600Height of the container.
radiusnumber12Collision radius of dots.
repelbooleantrueEnable mouse repulsion.
attractbooleanfalseEnable mouse attraction.
influenceRadiusnumber250Radius of mouse effect in pixels.
maxForcenumber3Strength of mouse effect.
speednumber1Velocity multiplier.
dotClassstring'fill-neutral-200'CSS classes for dots.

UI

This component's theme exposes the slots below. Override any of them per instance with the ui prop, or app-wide under ui.forceDot in app.config.ts.

Prop Type Default Description
uiobject-Per-slot classes merged over the theme defaults.
Slot Props Description
root-relative
svg-overflow-visible
dot-
Copyright © 2026