Skip to content

Click spark Updated#961

Open
R1SH4BH81 wants to merge 5 commits intomagicuidesign:mainfrom
R1SH4BH81:Click-Spark
Open

Click spark Updated#961
R1SH4BH81 wants to merge 5 commits intomagicuidesign:mainfrom
R1SH4BH81:Click-Spark

Conversation

@R1SH4BH81
Copy link
Copy Markdown

Description

This PR addresses recent code review feedback for the click-spark component. It significantly optimizes the animation loop to prevent unnecessary CPU/battery usage, fixes registry dependency imports, and completely modernizes the component's interactive demo.

Changes

  • Refactor (Performance): Paused the requestAnimationFrame loop in click-spark.tsx when there are no active sparks to save CPU and battery, automatically resuming on new clicks.
  • Feature (Demo): Redesigned the click-spark-demo.tsx aesthetic. Removed the basic button and replaced it with a premium, sleek silver gradient typography (Interactive Spark) to better showcase the effect.
  • Refactor (Dependencies): Removed the unused @magicui/dot-pattern from the registryDependencies in click-spark-demo.json and registry-examples.ts.
  • Bug Fix (Docs): Fixed the installation CLI command in click-spark.mdx to correctly point to add @magicui/click-spark.
  • Refactor: Extracted spark settings into a stable useRef to remove unnecessary re-renders and fix useEffect exhaustive-deps warnings.

Motivation

The previous implementation kept requestAnimationFrame running infinitely at 60fps even when the screen was empty, causing unnecessary background processing and battery drain. The demo component was also visually basic and didn't align with the premium aesthetic of the library. Lastly, the registry dependencies and docs contained minor inaccuracies that would confuse users during installation.

Breaking Changes

None. The component's props and usage remain entirely backwards compatible.

Screenshots

Device / Browser / Viewport: Desktop Chrome

image

@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

@R1SH4BH81 is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant