Torch Reveal

A torch that uncovers a hidden layer wherever the cursor points.

no dependenciesMIT · free

It's dark down here.

Move your torch around.

Installation

npx shadcn@latest add https://ombakui.com/r/torch-reveal.json

Usage

import { TorchReveal } from "@/components/torch-reveal";

<TorchReveal className="h-96" reveal={<img src="/secret.jpg" alt="" />}>
  <div className="size-full bg-black">It's dark down here.</div>
</TorchReveal>

Props

PropTypeDefaultDescription
children*ReactNode–What everyone sees.
reveal*ReactNode–What the torch uncovers, laid exactly on top of the children.
radiusnumber140Torch radius in px.
softnessnumber0.45Softness of the torch edge, 0–1.
classNamestring–