BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/fancy/cursor-attractor-and-gravity-image-demo

Cursor Attractor And Gravity Image Demo

fancy/cursor-attractor-and-gravity-image-demo
FreeBlock

A block component.

Install it

npx shadcn@latest add https://www.fancycomponents.dev/r/cursor-attractor-and-gravity-image-demo.json

Source

examples/physics/cursor-attractor-and-gravity-image-demo.tsxwww.fancycomponents.dev/r/cursor-attractor-and-gravity-image-demo.json
1import useScreenSize from "@/hooks/use-screen-size"
2import Gravity, {
3 MatterBody,
4} from "@/components/fancy/physics/cursor-attractor-and-gravity"
5
6export default function Preview() {
7 const screenSize = useScreenSize()
8
9 const getImageCount = () => {
10 if (screenSize.lessThan("sm")) return 50
11 if (screenSize.lessThan("md")) return 60
12 if (screenSize.lessThan("lg")) return 70
13 return 80
14 }
15
16 const getMaxSize = () => {
17 if (screenSize.lessThan("sm")) return 40
18 if (screenSize.lessThan("md")) return 50
19 return 60
20 }
21
22 const getMinSize = () => {
23 if (screenSize.lessThan("sm")) return 10
24 if (screenSize.lessThan("md")) return 20
25 return 20
26 }
27
28 return (
29 <div className="w-dvw h-dvh flex flex-col relative justify-center items-center md:items-end bg-white">
30 <div>
31 <p className="z-20 text-2xl sm:text-3xl md:text-3xl text-foreground dark:text-muted md:pr-24">
32 join the <span className="font-calendas italic">community</span>
33 </p>
34 </div>
35 <Gravity
36 attractorPoint={{ x: "33%", y: "50%" }}
37 attractorStrength={0.0005}
38 cursorStrength={-0.004}
39 cursorFieldRadius={screenSize.lessThan("sm") ? 100 : 200}
40 className="w-full h-full"
41 >
42 {[...Array(getImageCount())].map((_, i) => {
43 const size = Math.max(getMinSize(), Math.random() * getMaxSize())
44 return (
45 <MatterBody
46 key={i}
47 matterBodyOptions={{ friction: 0.5, restitution: 0.2 }}
48 x={`${Math.random() * 100}%`}
49 y={`${Math.random() * 30}%`}
50 >
51 <img
52 src={`https://randomuser.me/api/portraits/${i % 2 === 0 ? "men" : "women"}/${i}.jpg`}
53 alt={`Avatar ${i}`}
54 className="rounded-full object-cover hover:cursor-pointer"
55 style={{
56 width: `${size}px`,
57 height: `${size}px`,
58 }}
59 />
60 </MatterBody>
61 )
62 })}
63 </Gravity>
64 </div>
65 )
66}

What it pulls in

Other registry items

  • hooks/use-screen-size
  • fancy/physics/cursor-attractor-and-gravity

Files it writes

  • examples/physics/cursor-attractor-and-gravity-image-demo

Facts

Registry
fancy
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

www.fancycomponents.dev danielpetho/fancy on GitHub Raw registry item This item as JSON

More from fancy

All 158 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Gradient Demoanimated-gradient-demofancyBlocksFreeno deps
Basic Number Ticker Demobasic-number-ticker-demofancyBlocksFreeno deps
Box Carousel Autoplay Demobox-carousel-autoplay-demofancyBlocksFree1 dep
Box Carousel Demobox-carousel-demofancyBlocksFree1 dep
Box Carousel Video Demobox-carousel-video-demofancyBlocksFree1 dep
Breathing Text Demobreathing-text-demofancyBlocksFreeno deps
Circling Elements Democircling-elements-demofancyBlocksFreeno deps
Circling Elements Easing Democircling-elements-easing-demofancyBlocksFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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. Changelog

BlockDex