Button with dynamic glow that follows the cursor on hover.
npx shadcn@latest add https://refinery.abhii.me/r/glowy-button.json| Name | Type | Description |
|---|---|---|
| variant | "primary" | "ghost" | Visual style variant of the button. Dark opaque vs light surface. |
| size | "sm" | "md" | "lg" | Size of the button, affecting padding and font size. |
| colorFrom | string | Starting color for the glow gradient. Accepts any CSS color string. |
| colorTo | string | Ending color for the glow gradient. Accepts any CSS color string. |
| glowStrength | number | Intensity of the glow effect, ranging from 0 (no glow) to 1 (full glow). |
| className | string | Additional CSS classes to apply to the button for custom styling. |
| All native <button> attributes | - | onClick, disabled, type, etc. are all supported and can be passed directly to the component. |
I built the glow with layered elements: a conic gradient for the ambient edge light, and a radial gradient above it that follows the cursor like a small spotlight. You can tune the glow colors and use glowStrength to control how intense those layers feel. Motion handles the hover animation, and you can keep the defaults or adapt the layers for a softer product-style button.