Docs
Mouse String Connection
Mouse String Connection

An interactive cursor effect that draws animated dashed lines with arrows from the mouse to target elements, perfect for guiding user attention.

Something you really want

You can't live without this product. I'm sure of it.

Overview

The Mouse String Connection component creates an engaging visual connection between the user's cursor and important interface elements, making it perfect for guiding attention to call-to-action buttons and key features. It enhances user experience with smooth animations and customizable styling, helping reduce cognitive load and improve conversion rates. Essential for landing pages and interactive demonstrations where directing user focus is critical.

Installation

pnpm dlx shadcn@latest add https://deltacomponents.dev/r/mouse-string-connection.json

Usage

"use client"
 
import { Button } from "@/components/ui/button"
import MouseStringConnection from "@/registry/landing-page/mouse-string-connection"
 
export function Component() {
  return (
    <div className="flex items-center justify-center min-h-screen">
      <MouseStringConnection
        strokeWidth={2}
        dashArray={[10, 4]}
        curveIntensity={0.5}
      >
        <Button size="lg">Get Started</Button>
      </MouseStringConnection>
    </div>
  )
}

API Reference

Props

PropTypeDefaultDescription
childrenReactNode-Target element to connect cursor to (required)
strokeColorstring"hsl(var(--foreground) / 0.75)"Color of the connection line
strokeWidthnumber1Width of the connection line in pixels
dashArray[number, number][10, 4]Dash pattern for the line [dash, gap]
maxOpacitynumber0.75Maximum opacity of the connection line
curveIntensitynumber0.5Intensity of the curve (0 = straight, 1 = very curved)
arrowSizenumber10Size of the arrow head in pixels
fadeDistancenumber750Distance in pixels where line starts to fade
disabledbooleanfalseWhether to disable the connection effect
classNamestring""Additional CSS classes for the wrapper