BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Sora UI/cursor-bubble

Cursor Bubble

sora-ui/cursor-bubble
FreeComponent

A floating label that follows the cursor and elastic-pops into view over interactive targets, powered by GSAP.

Install it

npx shadcn@latest add https://ui.soralabs.io.vn/r/cursor-bubble.json

Source

registry/primitives/effects/cursor-bubble/index.tsxui.soralabs.io.vn/r/cursor-bubble.json
1/** biome-ignore-all lint/a11y/noNoninteractiveElementInteractions: The target wraps its own interactive child; the span only needs hover affordances. */
2/** biome-ignore-all lint/a11y/noStaticElementInteractions: Same as above — hover-only, no keyboard/click semantics of its own. */
3
4"use client";
5
6import { useGSAP } from "@gsap/react";
7import { cn } from "@/lib/utils";
8import gsap from "gsap";
9import {
10 type ComponentPropsWithoutRef,
11 createContext,
12 type ReactNode,
13 useContext,
14 useEffect,
15 useMemo,
16 useRef,
17 useState,
18} from "react";
19import { usePrefersReducedMotion } from "@/hooks/use-prefers-reduced-motion";
20
21const DEFAULT_LABEL = "click";
22const CURSOR_OFFSET_X = 13;
23const CURSOR_OFFSET_Y = -43;
24const FOLLOW_DURATION = 0.5;
25const POP_IN_DURATION = 1.7;
26const POP_IN_DELAY = 0.1;
27const POP_OUT_DURATION = 0.3;
28const RESTING_ROTATION = -30;
29
30interface CursorBubbleContextValue {
31 hide: () => void;
32 show: (label: string) => void;
33}
34
35const CursorBubbleContext = createContext<CursorBubbleContextValue | null>(
36 null
37);
38
39function useCursorBubbleContext() {
40 const context = useContext(CursorBubbleContext);
41
42 if (!context) {
43 throw new Error(
44 "CursorBubbleTarget must be used within a CursorBubble provider."
45 );
46 }
47
48 return context;
49}
50
51function useCoarsePointer() {
52 const [isCoarsePointer, setIsCoarsePointer] = useState(false);
53
54 useEffect(() => {
55 const mediaQuery = window.matchMedia("(pointer: coarse)");
56
57 const update = () => {
58 setIsCoarsePointer(mediaQuery.matches);
59 };
60
61 update();
62 mediaQuery.addEventListener("change", update);
63
64 return () => {
65 mediaQuery.removeEventListener("change", update);
66 };
67 }, []);
68
69 return isCoarsePointer;
70}
71
72export interface CursorBubbleProps
73 extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
74 /** Extra classes applied to the floating bubble itself (color, padding, shape, etc). */
75 bubbleClassName?: string;
76 children?: ReactNode;
77}
78
79function CursorBubble({
80 bubbleClassName,
81 children,
82 className,
83 ...props
84}: CursorBubbleProps) {
85 const bubbleRef = useRef<HTMLDivElement>(null);
86 const showRef = useRef<(label: string) => void>(() => undefined);
87 const hideRef = useRef<() => void>(() => undefined);
88 const prefersReducedMotion = usePrefersReducedMotion();
89 const isCoarsePointer = useCoarsePointer();
90 const disabled = prefersReducedMotion || isCoarsePointer;
91
92 useGSAP(
93 () => {
94 const bubble = bubbleRef.current;
95// … truncated

What it pulls in

npm packages

  • gsap
  • @gsap/react

Other registry items

  • @soralabs/hooks-use-prefers-reduced-motion

Files it writes

  • registry/primitives/effects/cursor-bubble/index.tsx

Facts

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

Go to the source

ui.soralabs.io.vn Raw registry item This item as JSON

More from Sora UI

All 97 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionSora UIComponentsFree2 deps
Border Trailborder-trailSora UIComponentsFree1 dep
Bottom Sheetbottom-sheetSora UIComponentsFree2 deps
Cursor Trail Revealcursor-trail-revealSora UIComponentsFree1 dep
Custom Cursorcustom-cursorSora UIComponentsFree2 deps
Accordion Demodemo-accordionSora UIComponentsFreeno deps
Border Trail Demodemo-border-trailSora UIComponentsFreeno deps
Border Trail Loading Card Demodemo-border-trail-loadingSora UIComponentsFreeno deps
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