Skip to content
@jcsoftdev/ui

Interactive playground

Liquid Glass, every knob

Move the sliders, pick a photo, drag the panel anywhere (or focus it and use the arrow keys), then copy the material prop or the CSS variables. What each option does: glass guide.

Liquid Glass
Backdrop

Checking lens support…

Preset
Custom
liquid (regular)
Crystal (minify)
Lens
1.670 to 2. Above 1 only the crystal profile bends further.
auto0 derives it from the size.
0.050
Material
0 px
1.00
1.00
0.000 is fully clear: no contrast guarantee.
Tint
0.00
#ffffff
Edge and light
0.60
0.00
-120°
1.00
0.00
Shadow
0.80
0 px
10 px
Shape
48 px
300 px
96 px
Motion and label
Drag (elastic)
Snappy
White, shadowed

material prop

<Card material="liquid" style={liquidStyle({
  profile: "crystal",
  refraction: 1.67,
  dispersion: 0.05,
  frost: 0,
  saturation: 1,
  rim: 0.6,
  specular: {
    intensity: 0,
  },
  fresnel: 1,
  radius: 48,
  opacity: 0,
  shadow: {
    opacity: 0.8,
  },
  interactive: "drag",
})}>
  Liquid Glass
</Card>

CSS variables

.my-glass {
  --liquid-refraction: 1.67;
  --liquid-profile: crystal;
  --liquid-dispersion: 0.05;
  --liquid-frost: 0px;
  --liquid-saturation: 1;
  --liquid-rim-strength: 0.6;
  --liquid-specular: 0;
  --liquid-fresnel: 1;
  --liquid-rim-custom: inset 1px 1.732px 0 -.5px color-mix(in srgb, white min(100%, calc(var(--liquid-rim-lit, .95) * 0.6 * 100%)), transparent), inset -1px -1.732px 0 -.5px color-mix(in srgb, white min(100%, calc(var(--liquid-rim-back, .7) * 0.6 * 100%)), transparent), inset 0 0 0 1px color-mix(in srgb, white min(100%, calc(var(--liquid-rim-ring, .5) * 0.6 * 100%)), transparent), inset 0 0 18px color-mix(in srgb, white min(100%, calc(0.4 * 100%)), transparent);
  --liquid-radius: 48px;
  --liquid-opacity: 0;
  --liquid-shadow-opacity: 0.8;
  --liquid-shadow-custom: 0 calc(var(--liquid-shadow-drop, 10px) * var(--liquid-size, 1)) calc(var(--liquid-shadow-blur, 30px) * var(--liquid-size, 1)) -6px color-mix(in srgb, var(--liquid-shadow-ink, black) min(100%, calc(var(--liquid-shadow-alpha, .2) * 0.8 * 100%)), transparent), 0 calc(2px * var(--liquid-size, 1)) calc(6px * var(--liquid-size, 1)) color-mix(in srgb, var(--liquid-shadow-ink, black) min(100%, calc(var(--liquid-shadow-alpha, .2) * 0.8 * var(--liquid-shadow-contact, .4) * 100%)), transparent);
  --liquid-interactive: drag;
}
/* with class="liquid" on the element */