ScanBeam
Animated gradient beam that sweeps across its container, creating a radar/scanner aesthetic. Renders as an absolutely positioned overlay with configurable color, speed, size, and direction.
Default Scan Beam
Preview
Content with scan beam overlay
Speed Variants
Preview
Slow (6s)
Normal (3s)
Fast (1.5s)
Direction
Preview
Sweep Down
Sweep Up
Custom Color & Opacity
Preview
Green beam
Red beam
Beam Size
Preview
Thin beam (10%)
Wide beam (40%)
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| color | string | var(--spectre-primary) | Beam color. Accepts any CSS color value or CSS variable. Defaults to the theme primary. |
| opacity | number | 0.3 | Opacity of the sweep beam (0 to 1). |
| speed | "slow" | "normal" | "fast" | "normal" | Animation speed of the sweep. slow = 6s, normal = 3s, fast = 1.5s. |
| size | number | 20 | Height of the beam as a percentage of the container (e.g. 20 = 20%). |
| direction | "down" | "up" | "down" | Direction of the sweep animation. |
| className | string | - | Additional CSS classes for the overlay container. |
Usage Tips
- The parent container must have
position: relativeandoverflow: hiddenfor the beam to be contained properly. - Content inside the container should use
className="relative z-10"to appear above the beam layer. - Recommended opacity range:
0.05–0.15for subtle ambiance,0.15–0.3for a prominent sweep effect. - When using a custom
color, pass a full CSS color value (e.g.#22c55e,rgb(34, 197, 94)). CSS variables likevar(--spectre-primary)also work. - Works great as a hero section effect, dashboard headers, or card decorations.
- Combine with
ScanlineOverlayfor a layered CRT + radar aesthetic.
Preview
Combined effectsScanBeam + your content
Accessibility
- The overlay has
aria-hidden="true"and is invisible to screen readers. - Uses
pointer-events-noneso it does not interfere with user interactions on content beneath it. - Purely decorative - no interactive elements or meaningful content.