Chapter 24: SVG Radial Gradients

SVG Radial Gradients are the circular / round / spotlight / shiny ball version — the colors spread outward from a central point like ripples in water, or like the glow from a light bulb, or a shiny metallic button, or a sunset sky in a circle.

Radial gradients are very popular for:

  • Shiny buttons and icons
  • Glassmorphism / neumorphism effects
  • Glowing orbs / neon balls
  • Realistic metal / plastic / glass textures
  • Spotlight effects on text or images
  • Backgrounds that feel “rounded” and soft

1. Basic Structure – The Two Main Tags

Just like linear, you need:

  1. <radialGradient> → defines the gradient (inside <defs>)
  2. fill=”url(#myRadial)” or stroke=”url(#myRadial)” → applies it

Basic skeleton:

XML

2. Key Attributes of <radialGradient>

Attribute What it means Default Most common values Notes
id Unique name to reference “shine”, “orb”, “metal” Must have!
cx Center X of the gradient (where brightest point starts) 50% 50%, 30%, 70% Horizontal center
cy Center Y 50% 50%, 40% Vertical center
r Radius of the gradient (how far colors spread) 50% 30%, 80%, 120% Size of the fade circle
fx / fy Focal point (where brightest spot is) Same as cx/cy 40%, 60% Makes it look like light from one side
gradientUnits Coordinate system objectBoundingBox objectBoundingBox, userSpaceOnUse objectBoundingBox = relative to shape (most used)
spreadMethod Behavior outside radius pad pad, reflect, repeat pad = solid color at edges

3. Your First Radial Gradient – Shiny Ball Effect (Copy-Paste Now!)

HTML

What you see:

  • A glowing blue orb with white highlight in top-left
  • Colors fade smoothly from center outward
  • Looks like light is coming from top-left → realistic 3D shine

4. Important Variations (Try Changing These!)

A. Perfect Center Glow (No Focal Point)

XML

B. Radial Gradient on Stroke (Glowing Border)

XML

→ Glowing ring around the circle

C. Glass / Frosted Glass Look (Semi-transparent)

XML

D. Multiple Stops + Reflect Spread (Mirror Repeat)

XML

→ Repeating gold-yellow rings

E. Focal Point Off-Center (Light from Side)

XML

5. Teacher’s Quick Tips (Hyderabad Student Style 😄)

  • Use cx/cy/fx/fy around 30%–70% → looks more realistic (center 50% can feel flat)
  • r=”50%–80%” is sweet spot for most buttons/icons — too big = flat, too small = tiny highlight
  • stop-opacity on stops → create transparent fade-outs (great for glass effects)
  • gradientUnits=”userSpaceOnUse” → fixed gradient size (good for background patterns)
  • Common mistake: Forget id or wrong url(#id) → solid color instead of gradient
  • Pro trick: Combine radial + linear gradient on same shape → metallic shine (linear base + radial highlight)

Understood SVG Radial Gradients now? They’re the secret behind most “premium” buttons, icons, loaders, and modern UI effects you see everywhere.

Tell me what you want next:

  • Animated radial gradient (pulsing shine / breathing orb)?
  • Full metallic button with radial + linear + shadow?
  • Radial gradient on text or stroke only?
  • Glassmorphism card with radial + blur?
  • Or compare linear vs radial in one example?

Just say — we can build any gradient style together right now! 🚀

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *