Spotlight Follow Button
A dynamic light source follows the cursor across the button creating a premium interactive spotlight effect
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/spotlight-follow-button.
<iframe src="/embed/spotlight-follow-button" sandbox="allow-scripts" loading="lazy" title="Spotlight Follow Button" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Spotlight Follow Button, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<button class="spotlight-btn">✦ SPOTLIGHT</button>CSS
.spotlight-btn {
position: relative;
padding: 1.25rem 2.5rem;
border-radius: 0.75rem;
background: linear-gradient(135deg, #0f172a, #1e293b);
color: #f1f5f9;
font-weight: 700;
border: 1px solid rgba(255,255,255,0.08);
cursor: pointer;
overflow: hidden;
transition: all 0.3s ease;
}
.spotlight-btn:hover { transform: scale(1.03); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.spotlight-btn:active { transform: scale(0.96); }
.spotlight-btn::before {
content: ''; position: absolute; inset: 0;
background: radial-gradient(circle 60px at 50% 50%, rgba(168,85,247,0.3), transparent 100%);
animation: spotlight-move 4s ease-in-out infinite;
pointer-events: none;
}
@keyframes spotlight-move { 0% { background: radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%); } 50% { background: radial-gradient(circle 60px at 70% 60%, rgba(168,85,247,0.3), transparent 100%); } 100% { background: radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%); } }Tailwind CSS
<button class="px-10 py-5 rounded-xl font-bold bg-gradient-to-br from-slate-900 to-slate-800 text-slate-100 border border-white/8 hover:scale-103 active:scale-96 transition-all overflow-hidden relative">
<span class="relative z-10">✦ SPOTLIGHT</span>
<div class="absolute inset-0 pointer-events-none" style="background: radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%); animation: spotlight-move 4s ease-in-out infinite;" />
</button>React
function SpotlightButton() {
return (
<motion.button
className="px-10 py-5 rounded-xl font-bold relative overflow-hidden"
style={{ background: 'linear-gradient(135deg, #0f172a, #1e293b)', color: '#f1f5f9', border: '1px solid rgba(255,255,255,0.08)', cursor: 'pointer' }}
whileHover={{ scale: 1.03, boxShadow: '0 20px 40px rgba(0,0,0,0.4)' }}
whileTap={{ scale: 0.96 }}
>
<span style={{ position: 'relative', zIndex: 10 }}>✦ SPOTLIGHT</span>
<motion.div
className="absolute inset-0 pointer-events-none"
style={{ background: 'radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%)' }}
animate={{ background: ['radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%)', 'radial-gradient(circle 60px at 70% 60%, rgba(168,85,247,0.3), transparent 100%)', 'radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%)'] }}
transition={{ duration: 4, repeat: Infinity, ease: 'easeInOut' }}
/>
</motion.button>
);
}LWC — HTML template
<template><button class="spotlight-btn" onclick={handleClick}><span style="position:relative;z-index:10"><slot>✦ SPOTLIGHT</slot></span></button></template>LWC — JavaScript
import { LightningElement, api } from 'lwc';
export default class SpotlightButton extends LightningElement {
@api label = '✦ SPOTLIGHT';
handleClick() { this.dispatchEvent(new CustomEvent('buttonclick', { bubbles: true, composed: true })); }
}LWC — CSS
.spotlight-btn { position: relative; padding: 1.25rem 2.5rem; border-radius: 0.75rem; background: linear-gradient(135deg, #0f172a, #1e293b); color: #f1f5f9; font-weight: 700; border: 1px solid rgba(255,255,255,0.08); cursor: pointer; overflow: hidden; transition: all 0.3s ease; }
.spotlight-btn:hover { transform: scale(1.03); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.spotlight-btn:active { transform: scale(0.96); }
.spotlight-btn::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%); animation: spotlight-move 4s ease-in-out infinite; pointer-events: none; }
@keyframes spotlight-move { 0% { background: radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%); } 50% { background: radial-gradient(circle 60px at 70% 60%, rgba(168,85,247,0.3), transparent 100%); } 100% { background: radial-gradient(circle 60px at 30% 40%, rgba(168,85,247,0.3), transparent 100%); } }LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<targets><target>lightning__AppPage</target><target>lightning__RecordPage</target><target>lightning__HomePage</target></targets>
</LightningComponentBundle>Where Spotlight Follow Button fits
- Hero Sections
- Premium CTAs
- Interactive Demos
- Landing Pages
Interaction states & animations
- Cursor Spotlight
- Reflection Movement
- Lighting
- Radial Highlight
Topics
- #spotlight
- #cursor
- #lighting
- #premium
- #interactive
- #highlight
Accessibility notes
Spotlight visual effect enhancement only — all functionality must work without it.
Browser support
- Chrome 76+
- Firefox 103+
- Safari 9+
- Edge 79+