A beautiful fluid glass morphism component for React
npm install fluid-glass-reactA beautiful fluid and liquid glass morphism component for React.
``bash`
npm install fluid-glass-react
`tsx
import { FluidGlass } from "fluid-glass-react";
function App() {
return (
borderRadius={30}
tintColor="#ffffff35" // background shade color
blurAmount={2} // blur amount
displacementScale={-40} // negative value give more glass effect
saturation={1.2} // 1-2 range
elasticity={8} // bigger value give stretched background effect
>
Hello World
);
}
`
| Prop | Type | Default | Description |
| ------------------- | ---------------- | --------------------- | ------------------- |
| id | string | "lg-dist" | SVG filter id |padding
| | string | "10px 20px" | Inner padding |borderRadius
| | string \| number | "24px" | Border radius |tintColor
| | string | "rgba(0, 0, 0, 0.04)" | Glass tint color |displacementScale
| | number | -30 | Distortion strength |blurAmount
| | number | 0 | Blur intensity |saturation
| | number | 1.2 | Color saturation |elasticity` | number | 8 | Effect elasticity |
|
MIT
Hanan
- GitHub: https://github.com/hananpk