Flashlight Reveal
Lights out. Your cursor is a flashlight with a dying battery that reveals a hidden layer.
- Zero dependencies
- React + Tailwind
- Accessible
- Reduced-motion aware
Preview
Animated · Full motion: idle animation, physics and effects. animated (default)
A dark surface hides a second layer. The cursor (or finger) becomes a flashlight with a soft hot-spot and a dying-battery flicker, and the beam reveals what's underneath.
Installation
$ npx shadcn@latest add https://guetix.com/r/flashlight-reveal.json
Uses the shadcn CLI. It creates components/guetix/flashlight-reveal.tsx and installs nothing else.
Usage
example.tsx
Easter eggsPromo codesBefore/after revealsStorytelling sections
Under the hood
The details that make it feel right, and that a one-line prompt usually misses:
- 01The beam is a CSS mask on the hidden layer, positioned with variables, so there is no canvas and no re-render per frame.
- 02A separate `mix-blend-mode: screen` glow layer adds the hot-spot without washing out the reveal.
- 03Battery flicker = `steps(1,end)` keyframes.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| hidden | ReactNode | — | What the beam reveals. |
| children | ReactNode | — | The dark surface. |
| radius | number | 130 | Beam radius (px). |
| beamColor | string | — | Beam tint. |
| animated | boolean | true | false = the calm “Regular” version (no idle or ambient motion). |
Accessibility
- A "Lights on" toggle reveals everything for keyboard and screen-reader users.
- Reduced motion: no flicker.