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-trail-reveal

Cursor Trail Reveal

sora-ui/cursor-trail-reveal
FreeComponent

Desktop cursor trail that reveals staggered image strips with clip-path wipes as the pointer moves.

Install it

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

Source

registry/primitives/effects/cursor-trail-reveal/index.tsxui.soralabs.io.vn/r/cursor-trail-reveal.json · first 6 KB
1"use client";
2
3import { cn } from "@/lib/utils";
4import { cva, type VariantProps } from "class-variance-authority";
5import { type ComponentPropsWithoutRef, useEffect, useRef } from "react";
6import { usePrefersReducedMotion } from "@/hooks/use-prefers-reduced-motion";
7
8const MASK_LAYER_COUNT = 10;
9const DEFAULT_IMAGE_SIZE = 175;
10
11const cursorTrailRevealVariants = cva(
12 "pointer-events-none absolute inset-0 z-[2] overflow-hidden",
13 {
14 variants: {
15 layout: {
16 default: "",
17 fill: "size-full",
18 },
19 },
20 defaultVariants: {
21 layout: "default",
22 },
23 }
24);
25
26interface TrailConfig {
27 easing: string;
28 imageLifespan: number;
29 inDuration: number;
30 mouseThreshold: number;
31 outDuration: number;
32 slideDuration: number;
33 slideEasing: string;
34 staggerIn: number;
35 staggerOut: number;
36}
37
38interface TrailImageEntry {
39 element: HTMLDivElement;
40 imageLayers: HTMLDivElement[];
41 maskLayers: HTMLDivElement[];
42 removeTime: number;
43}
44
45const MathUtils = {
46 lerp: (a: number, b: number, n: number) => (1 - n) * a + n * b,
47 distance: (x1: number, y1: number, x2: number, y2: number) =>
48 Math.hypot(x2 - x1, y2 - y1),
49};
50
51export interface CursorTrailRevealProps
52 extends Omit<ComponentPropsWithoutRef<"div">, "children">,
53 VariantProps<typeof cursorTrailRevealVariants> {
54 /** Viewport width above which the trail is active. */
55 desktopBreakpoint?: number;
56 /** Trail thumbnail size in pixels. */
57 imageSize?: number;
58 /** Image URLs cycled as the cursor moves (desktop only). */
59 images: readonly string[];
60 /** Background color behind each strip during the clip-path reveal. */
61 maskColor?: string;
62 /** Minimum pointer travel before spawning the next image. */
63 mouseThreshold?: number;
64}
65
66function CursorTrailReveal({
67 className,
68 desktopBreakpoint = 1000,
69 imageSize = DEFAULT_IMAGE_SIZE,
70 images,
71 layout = "default",
72 maskColor = "var(--background, #1a1a1a)",
73 mouseThreshold = 150,
74 ...props
75}: CursorTrailRevealProps) {
76 const trailContainerRef = useRef<HTMLDivElement>(null);
77 const animationStateRef = useRef<number | null>(null);
78 const trailRef = useRef<TrailImageEntry[]>([]);
79 const timeoutIdsRef = useRef<number[]>([]);
80 const currentImageIndexRef = useRef(0);
81 const mousePosRef = useRef({ x: 0, y: 0 });
82 const lastMousePosRef = useRef({ x: 0, y: 0 });
83 const interpolatedMousePosRef = useRef({ x: 0, y: 0 });
84 const isDesktopRef = useRef(false);
85 const prefersReducedMotion = usePrefersReducedMotion();
86// … truncated

What it pulls in

npm packages

  • class-variance-authority

Other registry items

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

Files it writes

  • registry/primitives/effects/cursor-trail-reveal/index.tsx

Facts

Registry
Sora UI
Type
registry:ui
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

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 Bubblecursor-bubbleSora UIComponentsFree2 deps
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

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