
More components in Pro
Galleries, cards and interactive pieces for pages that need more than the basics.
children | ReactNode | Content shown on the glass. | |
width | number | string | 200 | Width in px, or any CSS value like '100%'. |
height | number | string | 80 | Height in px, or any CSS value like '100vh'. |
borderRadius | 20 | Corner radius in px. Not used with a shape. | |
shape | URL of an SVG or transparent PNG that gives the glass its outline, fitted inside the width and height. Files from another origin need CORS headers. | ||
refraction | Bends what is behind the glass at its edges. Set it to false to use the frosted glass look everywhere. | ||
renderer | 'auto' | 'svg' | 'webgl' | 'auto' | How the glass bends light. Auto uses SVG filters in Chromium, which bend anything behind the glass, and WebGL in Safari and Firefox when a backdrop is given. Without a backdrop, those browsers get a frosted glass look. WebGL forces the WebGL glass whenever a backdrop is given. |
backdrop | RefObject<HTMLImageElement | HTMLVideoElement | HTMLCanvasElement> | The image, video or canvas behind the glass. WebGL can only bend what it is given, so pass this to get real refraction outside Chromium. Images from another origin need CORS headers. | |
distortionScale | -180 | How strongly the edge bends what is behind it. Negative values pull the view inward. | |
borderWidth | 0.07 | Width of the bending edge, as a fraction of the shorter side. | |
blur | 11 | Softness of the transition from the bending edge to the calm center, in px. | |
brightness | 50 | Brightness of the calm center, in %. 50 leaves it undistorted. | |
opacity | 0.93 | How strongly the calm center holds the view still, from 0 to 1. | |
displace | Blurs the light coming through the glass, for a frosted look. | ||
redOffset | Extra bending for the red channel. Different offsets split light into colored fringes. | ||
greenOffset | 10 | Extra bending for the green channel. | |
blueOffset | 20 | Extra bending for the blue channel. | |
backgroundOpacity | Opacity of a soft frosted tint over the glass, from 0 to 1. | ||
saturation | Saturation of what is seen through the glass. | ||
xChannel | 'R' | 'G' | 'B' | 'R' | Channel of the displacement map that moves pixels sideways. |
yChannel | 'R' | 'G' | 'B' | 'G' | Channel of the displacement map that moves pixels up and down. |
mixBlendMode | BlendMode | 'difference' | How the two edge gradients of the displacement map are combined. |
| Extra class names for the glass. | |||
{} | Inline styles for the glass. |
childrenReactNodeContent shown on the glass.
widthnumber | stringWidth in px, or any CSS value like '100%'.
200heightnumber | stringHeight in px, or any CSS value like '100vh'.
80borderRadiusnumberCorner radius in px. Not used with a shape.
20shapestringURL of an SVG or transparent PNG that gives the glass its outline, fitted inside the width and height. Files from another origin need CORS headers.
refractionbooleanBends what is behind the glass at its edges. Set it to false to use the frosted glass look everywhere.
renderer'auto' | 'svg' | 'webgl'How the glass bends light. Auto uses SVG filters in Chromium, which bend anything behind the glass, and WebGL in Safari and Firefox when a backdrop is given. Without a backdrop, those browsers get a frosted glass look. WebGL forces the WebGL glass whenever a backdrop is given.
'auto'backdropRefObject<HTMLImageElement | HTMLVideoElement | HTMLCanvasElement>The image, video or canvas behind the glass. WebGL can only bend what it is given, so pass this to get real refraction outside Chromium. Images from another origin need CORS headers.
distortionScalenumberHow strongly the edge bends what is behind it. Negative values pull the view inward.
-180borderWidthnumberWidth of the bending edge, as a fraction of the shorter side.
0.07blurnumberSoftness of the transition from the bending edge to the calm center, in px.
11brightnessnumberBrightness of the calm center, in %. 50 leaves it undistorted.
50opacitynumberHow strongly the calm center holds the view still, from 0 to 1.
0.93displacenumberBlurs the light coming through the glass, for a frosted look.
redOffsetnumberExtra bending for the red channel. Different offsets split light into colored fringes.
greenOffsetnumberExtra bending for the green channel.
10blueOffsetnumberExtra bending for the blue channel.
20backgroundOpacitynumberOpacity of a soft frosted tint over the glass, from 0 to 1.
saturationnumberSaturation of what is seen through the glass.
xChannel'R' | 'G' | 'B'Channel of the displacement map that moves pixels sideways.
'R'yChannel'R' | 'G' | 'B'Channel of the displacement map that moves pixels up and down.
'G'mixBlendModeBlendModeHow the two edge gradients of the displacement map are combined.
'difference'Extra class names for the glass.
Inline styles for the glass.
{}


