BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/componentry/cursor-driven-particle-typography

cursor-driven-particle-typography

componentry/cursor-driven-particle-typography
FreeComponent

Component for cursor-driven-particle-typography

Live preview

live · rendered by the registry
Rendered by componentry on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://componentry.dev/r/cursor-driven-particle-typography.json

Source

components/ui/cursor-driven-particle-typography.tsxcomponentry.dev/r/cursor-driven-particle-typography.json · first 6 KB
1"use client";
2
3import { cn } from "@workspace/ui/lib/utils";
4import React, { useEffect, useRef } from "react";
5
6export interface CursorDrivenParticleTypographyProps {
7 /** Additional CSS classes */
8 className?: string;
9 /** The text to render */
10 text: string;
11 /** Font size in pixels */
12 fontSize?: number;
13 /** Font family */
14 fontFamily?: string;
15 /** Size of each particle */
16 particleSize?: number;
17 /** Density of particles (lower number = more particles, minimum 1) */
18 particleDensity?: number;
19 /** How strongly the cursor pushes particles away */
20 dispersionStrength?: number;
21 /** Speed at which particles return to origin */
22 returnSpeed?: number;
23 /** Custom color for particles. Overrides inherited text color if set. */
24 color?: string;
25}
26
27class Particle {
28 x: number;
29 y: number;
30 originX: number;
31 originY: number;
32 vx: number;
33 vy: number;
34 size: number;
35 color: string;
36 dispersion: number;
37 returnSpd: number;
38
39 constructor(
40 x: number,
41 y: number,
42 size: number,
43 color: string,
44 dispersion: number,
45 returnSpd: number
46 ) {
47 this.x = x + (Math.random() - 0.5) * 10; // start with slight randomness
48 this.y = y + (Math.random() - 0.5) * 10;
49 this.originX = x;
50 this.originY = y;
51 this.vx = (Math.random() - 0.5) * 5;
52 this.vy = (Math.random() - 0.5) * 5;
53 this.size = size;
54 this.color = color;
55 this.dispersion = dispersion;
56 this.returnSpd = returnSpd;
57 }
58
59 update(mouseX: number, mouseY: number) {
60 const dx = mouseX - this.x;
61 const dy = mouseY - this.y;
62 const distance = Math.sqrt(dx * dx + dy * dy);
63
64 // Physics interaction with mouse
65 const interactionRadius = 120; // 120px interaction radius
66
67 if (distance < interactionRadius && mouseX !== -1000 && mouseY !== -1000) {
68 const forceDirectionX = dx / distance;
69 const forceDirectionY = dy / distance;
70
71 const force = (interactionRadius - distance) / interactionRadius;
72
73 // Calculate repulsion
74 const repulsionX = forceDirectionX * force * this.dispersion;
75 const repulsionY = forceDirectionY * force * this.dispersion;
76
77 this.vx -= repulsionX;
78 this.vy -= repulsionY;
79 }
80
81 // Return to origin (spring physics)
82// … truncated

Facts

Registry
componentry
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on componentry componentry.dev harshjdhv/componentry on GitHub Raw registry item This item as JSON

More from componentry

All 59 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Gradientanimated-gradientcomponentryComponentsFreeno deps
ASCII Effectascii-effectcomponentryComponentsFreeno deps
Aurora Flowaurora-flowcomponentryComponentsFreeno deps
auth-modalauth-modalcomponentryComponentsFreeno deps
border-beamborder-beamcomponentryComponentsFreeno deps
circuit-boardcircuit-boardcomponentryComponentsFreeno deps
closing-plasmaclosing-plasmacomponentryComponentsFreeno deps
collection-surfercollection-surfercomponentryComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex