BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/pixelflow-ui/proximity-text

Proximity Text

pixelflow-ui/proximity-text
FreeComponent

pixelflow-ui publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://pixelflowui.lok1.dev/r/proximity-text.json

Source

src/registry/text-effects/nova/ProximityText.jsxpixelflowui.lok1.dev/r/proximity-text.json
1"use client";
2
3import React, { useEffect, useRef } from "react";
4
5const ProximityText = ({ text }) => {
6 const wordRef = useRef([]);
7 const isHoverRef = useRef(false);
8 const rectsRef = useRef([]);
9
10 const cacheRects = () => {
11 rectsRef.current = wordRef.current.map((el) => el.getBoundingClientRect());
12 };
13
14 const resetWeights = () => {
15 wordRef.current.forEach((el) => (el.style.fontWeight = "400"));
16 };
17
18 useEffect(() => {
19 const handleMouse = (e) => {
20 if (!isHoverRef.current) return;
21 const mouseX = e.clientX;
22 const maxDistance = 30;
23
24 rectsRef.current.forEach((rect, i) => {
25 const centerX = rect.left + rect.width / 2;
26 const distance = Math.abs(mouseX - centerX);
27 const weight = Math.max(
28 400,
29 Math.round(900 - (distance / maxDistance) * 500)
30 );
31 wordRef.current[i].style.fontWeight = String(weight);
32 });
33 };
34
35 window.addEventListener("mousemove", handleMouse);
36 return () => window.removeEventListener("mousemove", handleMouse);
37 }, []);
38
39 return (
40 <span
41 onMouseEnter={() => {
42 isHoverRef.current = true;
43 cacheRects();
44 }}
45 onMouseLeave={() => {
46 isHoverRef.current = false;
47 resetWeights();
48 }}
49 className="cursor-pointer inline-flex"
50 >
51 {text.split("").map((letter, i) => (
52 <span
53 ref={(el) => {
54 if (el) wordRef.current[i] = el;
55 }}
56 key={i}
57 className="transition-all duration-150 font-[family-name:var(--font-inter)]"
58 >
59 {letter === " " ? "\u00A0" : letter}
60 </span>
61 ))}
62 </span>
63 );
64};
65
66export default function Demo() {
67 return (
68 <div className="flex items-center justify-center text-4xl text-white">
69 <ProximityText text="Hover over me" />
70 </div>
71 );
72}
73

Files it writes

  • src/registry/text-effects/nova/ProximityText.jsx

Facts

Registry
pixelflow-ui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-12
Last confirmed
today

Go to the source

Docs on pixelflow-ui pixelflowui.lok1.dev lokidotdev/pixelflow-ui on GitHub Raw registry item This item as JSON

More from pixelflow-ui

All 35 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordion Lyraaccordion-lyrapixelflow-uiComponentsFree3 deps
Accordion Novaaccordion-novapixelflow-uiComponentsFree3 deps
Accordion Retroaccordion-retropixelflow-uiComponentsFree3 deps
Background 1background-1pixelflow-uiComponentsFreeno deps
Background 1Retrobackground-1-retropixelflow-uiComponentsFreeno deps
Bouncy Input Lyrabouncy-input-lyrapixelflow-uiComponentsFree1 dep
Bouncy Input Novabouncy-input-novapixelflow-uiComponentsFree1 dep
Bouncy Input Retrobouncy-input-retropixelflow-uiComponentsFree1 dep
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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

© 2026 BlockDex. A Kynth Studios product.

BlockDex