Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

react-push-dot-grid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-push-dot-grid

A React canvas component that creates an interactive dot grid with push/pull mouse effects

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-push-dot-grid

An interactive React canvas component that creates a dot grid with push/pull mouse effects.

Installation

npm install react-push-dot-grid

Usage

import { PushDotGrid } from "react-push-dot-grid";

function App() {
  return (
    <div style={{ width: "100%", height: "400px" }}>
      <PushDotGrid type="push" dotSpace={28} dotRadius={1} strength={0.35} />
    </div>
  );
}

Props

PropTypeDefaultDescription
type"push" | "pull""push"Direction of the mouse effect
dotSpacenumber28Spacing between dots in pixels
dotRadiusnumber1Base radius of each dot
strengthnumber0.35Force strength of the effect
maxDistnumber120Mouse influence radius in pixels
classNamestringCSS class for the wrapper div
styleobjectInline styles for the wrapper div

Imperative API

Use a ref to access imperative methods:

import { useRef } from "react";
import { PushDotGrid } from "react-push-dot-grid";

function App() {
  const gridRef = useRef(null);

  return (
    <>
      <PushDotGrid ref={gridRef} type="push" />
      <button onClick={() => gridRef.current.reset()}>Reset</button>
    </>
  );
}

Methods

MethodDescription
reset()Reinitializes the dot grid

Notes

  • The component fills its parent container — make sure the parent has a defined width and height.
  • Works with both push and pull modes.

License

MIT

Keywords

react

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts