Skip to content
PixiKit

Glass Pane

A pane of glass that bends and splits the light of whatever is behind it at its edges, with a calm center for content.

pixikit.com/docs/components/glass-pane

Customize

Width320px
Height76px
Border radius38px
Refraction
Renderer
Distortion scale-180
Border width0.07
Blur11px
Brightness50%
Opacity0.93
Displace0.5
Red offset0
Green offset10
Blue offset20
Background opacity0.10
Saturation1.00
X channel
Y channel
Mix blend mode

Props

24
NameTypeDefaultDescription
childrenReactNodeNoneContent shown on the glass.
widthnumber | string200Width in px, or any CSS value like '100%'.
heightnumber | string80Height in px, or any CSS value like '100vh'.
borderRadiusnumber20Corner radius in px. Not used with a shape.
shapestringNoneURL 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.
refractionbooleantrueBends 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.
backdropRefObject<HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null>NoneThe 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.
distortionScalenumber-180How strongly the edge bends what is behind it. Negative values pull the view inward.
borderWidthnumber0.07Width of the bending edge, as a fraction of the shorter side.
blurnumber11Softness of the transition from the bending edge to the calm center, in px.
brightnessnumber50Brightness of the calm center, in %. 50 leaves it undistorted.
opacitynumber0.93How strongly the calm center holds the view still, from 0 to 1.
displacenumber0Blurs the light coming through the glass, for a frosted look.
redOffsetnumber0Extra bending for the red channel. Different offsets split light into colored fringes.
greenOffsetnumber10Extra bending for the green channel.
blueOffsetnumber20Extra bending for the blue channel.
backgroundOpacitynumber0Opacity of a soft frosted tint over the glass, from 0 to 1.
saturationnumber1Saturation 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.
mixBlendModeCSSProperties["mixBlendMode"]"difference"How the two edge gradients of the displacement map are combined.
classNamestring""Extra class names for the glass.
styleCSSProperties{}Inline styles for the glass.

More interaction components in Pro

View all

Related