AndrewPrifer / progressive-blur

Home Page:https://progressive-blur.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Progressive Blur

Drop-in progressive (gradient) backdrop blur for React. Both radial and linear gradients are supported.

Progressive.Blur.Demo.2024-04-19T19.33.14.mp4

Demo

Installation

yarn add progressive-blur

Usage

import { RadialBlur, LinearBlur } from "progressive-blur";

const App = () => (
  <div>
    <RadialBlur
      // The resolution of the blur. Higher values will result in a more detailed blur, but will be more computationally expensive. Default is 8.
      steps={8}
      // The blur radius of the blur in pixels at the peak of the gradient. Default is 64.
      strength={64}
      // How much of the blur is falloff. 0 means no falloff, 100 means the entire blur is falloff. Default is 100.
      falloffPercentage={100}
      // The tint applied to the blur. This can be any valid CSS color. Default is transparent.
      tint="rgba(0, 0, 0, 0.1)"
      // You can pass any div props to the component. Useful for positioning.
      style={{
        position: "absolute",
        inset: 0,
        zIndex: -1,
      }}
    />
    <LinearBlur
      // Same props as RadialBlur, but with an additional side prop that specifies the direction of the gradient and the transform origin so it's easy to scale in the right direction. Default is "top".
      side="top"
    />
  </div>
);

About

https://progressive-blur.vercel.app

License:MIT License


Languages

Language:TypeScript 79.5%Language:CSS 15.7%Language:HTML 2.4%Language:JavaScript 2.3%