Surfaces
LiquidGlass
The SVG refraction layer that Surface paints when material is "liquid". Opt-in: use it directly only for a custom glass container.
<script>
import { LiquidGlass, GLASS_OPTICS } from "@codeatlasdev/ui";
</script>
<div class="my-glass">
<LiquidGlass optics={GLASS_OPTICS.regular} />
<slot />
</div>
You rarely need this. Surface with material="liquid" renders LiquidGlass for you and picks the optics from its elevation. The component is an absolutely positioned, aria-hidden SVG that fills its parent and inherits the parent’s border radius, so the parent needs position: relative and overflow: hidden. It only adds the refraction; the blur, tint and border come from the glass material classes on the parent.
GLASS_OPTICS maps each material thickness (ultra-thin, thin, regular, thick, chrome) to a ready-made optics object.
Refraction layer
Refraction layer behind this text.
Reference #075 · Pick in the gallery
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
optics | { frost, bend, depth, curvature, sheen, dispersion: number } | – | Optical parameters of the refraction filter. Required. Take one from `GLASS_OPTICS`. |
style | string | '' | Extra inline style for the SVG. |