Glowing Effect

A dynamic proximity-based glow effect that reacts to mouse movements and scroll events, perfect for highlighting interactive elements.

API

Prop NameTypeDefaultDescription
blurnumber0The blur radius applied to the glow layer.
inactiveZonenumber0.7Defines the inner radius (as a fraction of the smallest dimension) within which the glow is inactive.
proximitynumber0Additional proximity distance (in pixels) to trigger the glow when the cursor is near the element.
spreadnumber20Size of the spread of the glow effect around the element.
variant"default" | "white""default"Variant of the glow style (e.g., a white-themed version).
glowbooleanfalseControls the visibility of the static glow border.
classstring""Additional CSS classes for custom styling.
disabledbooleantrueDisables the proximity detection and glow animations when true.
movementDurationnumber2Duration (in seconds) of the smooth rotation animation.
borderWidthnumber1Width (in pixels) of the border applied to the glow effect.

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://inspira-ui.com/r/glowing-effect.json"

Install Manually

You can copy and paste the following code to create this component:

GlowingEffect.vue

Features

  • Proximity-Based Activation: The glow effect is only active when the cursor is within a certain distance of the element.
  • Smooth Angle Animation: Gradually animates rotation based on pointer movement for an appealing dynamic glow.
  • Configurable Glow Properties: Fine-tune blur, spread, and proximity to achieve various visual effects.
  • Variant Support: Choose between default or white glow styling.
  • Performance Optimizations: Event listeners and animation frames are managed efficiently.

Credits