Move beyond linear backgrounds with CSS radial-gradient, a function for creating gradients that radiate from a central point. The real power comes from controlling the gradient’s shape (circle or ellipse), its size, and its origin point using the at keyword. Explore practical examples from creating subtle vignettes and soft glows to building intricate sunburst patterns and repeating circles by layering multiple gradients. Because this is all handled in pure CSS, it’s a lightweight and resolution-independent alternative to background images, which can be easily animated by manipulating its properties via CSS Custom Properties.
21 CSS radial-gradient Examples
Rounded Triangle CSS Image Mask
demo & codeThis Rounded Triangle CSS Image Mask offers a mathematically perfect way to shape visuals into equilateral triangles with soft, professional edges. It is an ideal choice for high-end portfolio galleries, creative team sections, or landing pages where standard rectangular or circular crops feel too conventional. By leveraging modern CSS math, the shape remains perfectly symmetrical regardless of the image dimensions.
Mouse-Tracking Linear Shine Button
demo & codeThis Mouse-Tracking Linear Shine Button adds a high-end, tactile feel to your UI. Unlike standard hover effects that simply swap colors, this component tracks the user’s cursor position to drag a realistic light reflection across the button’s surface. Built with React and Tailwind CSS, it utilizes reactive CSS variables to control gradient positions, creating a dynamic lighting effect that feels physical and responsive.
Blooming Night Garden Animation
demo & codeThis Blooming Night Garden Animation is a delightful example of “CSS Art,” where HTML elements are shaped into complex illustrations using code. It features a complete scene with a textured night sky, procedurally blooming flowers, swaying grass, and a particle system of floating hearts, all brought to life through choreographed CSS keyframes.
Hyperplexed Evervault Card Hover Effect
demo & codeThis Hyperplexed Evervault Card Hover Effect utilizes dynamic character generation and CSS masking to create a high-tech “decryption” visual. It replicates the sophisticated card interactions found on the Evervault website, blending procedural text with mouse-responsive radial gradients.
Stripe-Inspired Cards Hover Effect
demo & codeThis Stripe-Inspired Cards Hover Effect replicates the sophisticated “flashlight” border interaction seen on modern SaaS websites. Instead of a simple color change, a soft radial gradient follows the user’s mouse cursor across a grid of cards. This creates a cohesive, lighting-aware interface where elements seem to illuminate as you interact with them.
Images Inside Wiggly Boxes
A decorative image frame created entirely with CSS mask compositing. It combines radial-gradient layers with conic-gradient and the intersect composite operator to sculpt a scalloped, wavy border, while the CSS round() function ensures perfect pattern alignment along the edges.
See the Pen Images Inside Wiggly Boxes.
Wavy Image Gallery
Images appear as jigsaw puzzle pieces with interlocking edges that can visually fit together.
See the Pen Wavy Image Gallery.
Uninvert Kitty
An interactive spotlight reveal where the cursor controls a negative mask and a physical 3D tilt effect.
See the Pen Uninvert Kitty.
CSS-Only Pattern: Circles
An elegant, geometrically complex background in blue tones that looks like a vector illustration but weighs only a few bytes and scales easily.
See the Pen CSS-Only Pattern: Circles.
Single Element Progress
Elegant, segmented radial charts that smoothly fill upon page load, showcasing the capabilities of modern CSS without JavaScript.
See the Pen Single Element Progress.
Scalable CSS Radial Gradient Pattern
A pure CSS pattern created by overlaying five radial-gradient declarations on a single element. The main feature is that all ring sizes and their count depend on a couple of CSS variables, making the pattern fully scalable using calc().
See the Pen Scalable CSS Radial Gradient Pattern.
Interactive Card Glow Effect
A modular React card component where a single pointermove listener updates CSS variables, powering a customizable, multi-layer glow and spotlight effect.
See the Pen Interactive Card Glow Effect.
Dissolving Image Edges
Creating a “grainy” edge effect for a circular image using SVG filters. The effect is achieved through a complex combination of feGaussianBlur and feTurbulence primitives with multiple feComposite operations to control the alpha channel.
See the Pen Dissolving Image Edges.
Multi-Card Spotlight Effect
An interactive 3D card effect where JavaScript tracks pointermove, calculates the relative cursor position, and passes it to --ratio-x and --ratio-y CSS variables, while CSS uses calc() to drive rotateX and rotateY.
See the Pen Multi-Card Spotlight Effect.
Realistic MPK Mini MIDI Controller in Pure CSS
Pure CSS skeuomorphism in action - a complete replica of a MIDI controller where every knob, pad, and key is drawn by layering dozens of gradients and shadows.
See the Pen Realistic MPK Mini MIDI Controller in Pure CSS.
Stacked Poetic Cards
A dynamic card carousel/stack technically driven entirely by CSS custom properties and the :has() selector; interactivity is achieved via the “Radio Button Hack” (hidden input[type="radio"]), where selecting one card recalculates variables for all others, creating a smooth 3D transformation effect and dynamic stacking order; a decorative dotted background and a responsive grid layout complement the functionality.
Upload UI
An adaptive UI component of cards for different states (loading, success, error), built on a scalable SCSS architecture. Color schemes are managed by variables, a custom @mixin handles the adaptive Flexbox layout via media queries, and a radial-gradient creates the glow effect.
See the Pen Upload UI.
Cosmic 404 Page
A modern, atmospheric interface that transforms a standard error into a pleasant visual experience, where content gently floats above a deep, iridescent cosmic background.
See the Pen Cosmic 404 Page.
iPhone 14
A minimalist gallery showcasing iPhone 14 wallpaper concepts, crafted entirely in CSS. Each “phone” mockup uses a split-screen design with multi-stop radial gradients and CSS custom properties to generate vibrant, glowing orb-like backgrounds.
See the Pen iPhone 14.
Weather Widget
A vivid weather widget styled with complex CSS radial gradients to mimic a sky backdrop. Classic float-based layout structures the content, while @keyframes bring life to FontAwesome icons, animating the sun’s rotation and the clouds’ drifting motion."
See the Pen Weather Widget.
Eclipse Badge
An “eclipse” or running glint effect implemented in pure CSS. The @keyframes eclipse animation infinitely moves a white div from one edge to the other using transform: translateX, creating the illusion of a moving light source.