Back to Explore
THE PLAYGROUND · CORE MOTION

Glow

A soft halo brightens around an element.

GlowCore Motion · A soft halo brightens around an element.
HOVER
A little brilliance.
MOVE POINTER · OR REPLAY · 600 ms
1import { useState } from "react";2import { motion } from "motion/react";3 4const surface = { width: 100, height: 100, borderRadius: 16, background: "#b8ed79", display: "grid", placeItems: "center", color: "#141714" };5 6export default function GlowDemo() {7  const [run, setRun] = useState(0);8  return <div>9    <button onClick={() => setRun(v => v + 1)}>Replay</button>10    <motion.div key={run} style={surface} animate={{11  "boxShadow": [12    "0 0 0px #b8ed79",13    "0 0 36px #b8ed79",14    "0 0 0px #b8ed79"15  ]16}} transition={{ duration: 0.6, delay: 0, ease: "easeInOut" }}>Motion</motion.div>17  </div>;18}

Install: npm install motion. Use a pseudo-element for a lightweight glow.