Micro-interactions

Torchlight

Content hidden in darkness; the cursor is a torch that reveals only what it touches.

Install

bun add clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/torchlight/torchlight.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
radiusnumber140Torch light radius.
softnessnumber0.5Falloff softness of the light edge.
darknessnumber0.92How hidden the surrounding content is.
restRevealnumber0Ambient reveal away from the torch.
smoothingnumber0.15How much the light lags the cursor.
flickernumber0.15Subtle torch flicker (off under reduced motion).
torchColorstring (hex)"#a855f7"Amethyst torch tint.

What It Demonstrates

Mask
Hiding or revealing parts of an element using a shape or gradient — like clip-path, but with soft, fadeable edges.
Reveal
Content is uncovered gradually, often by animating a clip-path or mask.
Hover effect
Visual change when the cursor moves over an element.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.

Related Components

Appears In