Demo
Click here to see it in action!

✨ Features
Proper edgy bending and refraction
Multiple refraction modes
Configurable frosty level
Supports arbitrary child elements
Configurable paddings
Correct hover and click effects
Edges and highlights take on the underlying light like Apple's does
Configurable chromatic aberration
Configurable elasticity, to mimic Apple's "liquid" feel
⚠️ NOTE: Safari and Firefox only partially support the effect (displacement will not be visible)
🚀 Usage
Installation
Basic Usage
Button Example
Mouse Container Example
When you want the glass effect to respond to mouse movement over a larger area (like a parent container), use the mouseContainer prop:
Props
Prop | Type | Default | Description |
|---|---|---|---|
|
| - | The content to render inside the glass container |
|
|
| Controls the intensity of the displacement effect |
|
|
| Controls the blur/frosting level |
|
|
| Controls color saturation of the glass effect |
|
|
| Controls chromatic aberration intensity |
|
|
| Controls the "liquid" elastic feel (0 = rigid, higher = more elastic) |
|
|
| Border radius in pixels |
|
|
| Additional CSS classes |
|
| - | CSS padding value |
|
| - | Additional inline styles |
|
|
| Whether the glass is over a light background |
|
| - | Click handler |
|
|
| Container element to track mouse movement on (defaults to the glass component itself) |
|
|
| Refraction mode for different visual effects. |
|
| - | Global mouse position coordinates for manual control |
|
| - | Mouse position offset for fine-tuning positioning |