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 |
|---|---|---|---|
count | number | 80 | Number of dots. |
width | number | 600 | Width of the container. |
height | number | 600 | Height of the container. |
radius | number | 12 | Collision radius of dots. |
repel | boolean | true | Enable mouse repulsion. |
attract | boolean | false | Enable mouse attraction. |
influenceRadius | number | 250 | Radius of mouse effect in pixels. |
maxForce | number | 3 | Strength of mouse effect. |
speed | number | 1 | Velocity multiplier. |
dotClass | string | '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 |
|---|---|---|---|
ui | object | - | Per-slot classes merged over the theme defaults. |
| Slot | Props | Description |
|---|---|---|
root | - | relative |
svg | - | overflow-visible |
dot | - |