Skip to content
synccn

Magnetic

Pulls its child toward the pointer.

Installation

$ pnpm dlx shadcn@latest add @synccn/magnetic

First time in this project? Connect synccn with one command.

Usage

import { Magnetic } from "@/components/ui/ripple-button";<Magnetic><Button>Hover</Button></Magnetic>

API reference

Generated from the component's TypeScript types, so it always matches the code.

Magnetic

Pulls its child toward the pointer when it comes close.

  • strength
    number

    Default 0.35

    How far the child follows the pointer, 0–1.

  • children
    React.ReactNode

    Content to render.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Components

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

No ARIA roles, key handling or motion settings in its source. It renders plain elements, so its accessibility comes from the content and labels you give it.