Liquid material

A material for any element: glass, frosted or solid. Glass bends the live content behind it and splits it into a thin rainbow, frosted blurs it; panes brought close flow together like drops, and stretch and settle as they move.

Install

Terminal
npx airflib@latest add liquid-material

Usage

TSX
import { LiquidMaterial } from "@/components/airflib/components/liquid-material";

<LiquidMaterial
  tone="light"
  material="glass"
  gravity={20}
  elasticity={0.6}
  depth={50}
  frost={20}
  highlight={100}
  refraction={40}
  dispersion={30}
  saturation={1.5}
/>

API

Its main settings, read from the code: each prop's type and default. The prompt lists every prop.

NameTypeDefaultDescription
tone"light" | "dark""light"Tint and rim light for a light or a dark page.
material"solid" | "frosted" | "glass""glass"What the pane is made of (see LiquidMaterialKind); the group's material is its panes'.
gravitynumber20pxIn a group: how close two panes come, in px, before they start to flow together. A neck forms between them and thickens as they near, as two drops of water meet; 0 joins them only when they touch. From 0 to 48px.
elasticitynumber0.60–1: how much the glass gives. The pane is always exactly where you put it; its glass stretches along the way it moves, the faster the more, squashes and jiggles back into shape when it stops, as a drop of water does, and swells evenly under a press. 0 is rigid. From 0 to 1.
depthnumber50%Glass: depth, 0–100, how thick the glass looks and how far in from the edge it bends. 0 is a thin rim with a clear middle, 50 bends all the way to the middle, 100 is a lens with no flat spot. Relative to the glass's size, so a button and a panel agree. From 0 to 100%.
frostnumber20%, frosted: 52%Frost, 0–100: how matte the glass is, from a breath of blur (0) to fully matte (100). Unset, Frosted takes 52. From 0 to 100%.
highlightnumber100%, frosted: 25%Highlight, 0–100: how bright the rim light is, or on Frosted how deep its dip reads; 0 is none. Unset, Frosted takes 25. From 0 to 100%.
refractionnumber40pxGlass: how far the edge bends what lies behind it, at its strongest, in px. From 0 to 120px.
dispersionnumber30%Glass: 0–100, how far red, green and blue split where the edge bends, a thin rainbow. From 0 to 100%.
saturationnumber1.5Glass: colour lift of what is behind, 1 = none. From 1 to 2.5.

Sound

The sounds in the catalog are the site's. The block comes silent, with a place for your own.

Used in