logo

Create Amazing Gradients Using WebGL

High-performance React component for animated WebGL gradient backgrounds with real-time customization.

Meera Dev Logo

WebGL-Powered Gradient Backgrounds

High-performance, fully customizable animated gradients for modern web applications

High Performance

Hardware-accelerated WebGL rendering with optimized shaders for smooth 60fps animations

Fully Customizable

7 gradient types with real-time color, speed, scale, and noise controls

Easy Integration

Drop-in React component with TypeScript support and zero configuration

Installation

Get started in seconds. Install the package via npm.

01

Install Package

npm install gradflow
02

Import & Use

Import the component and start using it right away

import { GradFlow } from 'gradflow'

function App() {
  return (
    <div className="relative h-screen">
      <GradFlow />
      {/* Your content here */}
    </div>
  )
}

Usage Examples

Customize colors, animation speed, scale, and noise settings to create unique gradient backgrounds.

With Custom Colors

Use RGB objects or hex strings

import { GradFlow } from 'gradflow'

<GradFlow
  config={{
    color1: '#e2624b',
    color2: '#ffffff',
    color3: '#1e229f',
    speed: 0.4,
    scale: 1,
    type: 'stripe',
  }}
/>

Using Presets

Choose from 8 built-in gradient presets

import { GradFlow, PRESETS } from 'gradflow'

<GradFlow config={PRESETS.cosmic} />

// Available presets:
// cosmic, matrix, electric, inferno, mystic, cyber, neon, plasma

Random Gradients

Generate random colors for unique gradients

import { GradFlow, generateRandomColors } from 'gradflow'

const [colors, setColors] = useState(generateRandomColors())

<GradFlow config={colors} />
<button onClick={() => setColors(generateRandomColors())}>
  Randomize
</button>

Configuration

All available configuration options for the GradFlow component

PropertyTypeDefaultDescription
color1string | RGB{r:226,g:98,b:75}First gradient color (hex or RGB)
color2string | RGB{r:255,g:255,b:255}Second gradient color (hex or RGB)
color3string | RGB{r:30,g:34,b:159}Third gradient color (hex or RGB)
speednumber0.4Animation speed (0.1 - 3.0)
scalenumber1Pattern scale (0.5 - 3.0)
typestring'stripe'Gradient pattern type
linearanimatedconicwavesilksmokestripe
noisenumber0.08Noise intensity (0 - 0.5)