# Animated Gradient With SVG

> An animated multi-color gradient background effect with SVG elements.  Animated gradients can be achieved with many different techniques (shaders, CSS gradients, etc.), this component uses simple SVG circles with a blur filter to create the effect.  1. For each color in the colors prop array, the component creates an SVG circle element 2. Each circle is given a random initial position using percentage values 3. The movement of each circle is controlled by 8 CSS variables that define target positions: --tx-1 and --ty-1 for the first position --tx-2 and --ty-2 for the second position And so on for positions 3 and 4 4. These variables are set to random values between -0.5 and 0.5.

- Author: [Daniel Petho](https://21st.dev/@danielpetho)
- Library: [Fancy Components](https://21st.dev/@danielpetho/library/fancy-components)
- License: mit
- Tags: Landing Page, Gradient, Bento, Background, Statistics
- Live preview: https://21st.dev/@danielpetho/components/animated-gradient-with-svg

## Install

```bash
npx shadcn@latest add "https://21st.dev/r/danielpetho/animated-gradient-with-svg?api_key=$API_KEY_21ST"
```

Requires a 21st API key (generate one at https://21st.dev/mcp) passed as `API_KEY_21ST`. Free accounts get a limited number of installs per day; unlimited on a paid plan — see https://21st.dev/pricing.

Full component directory: https://21st.dev/llms.txt · More like this: https://21st.dev/community/components/s/landing-page.md
