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
npx airflib@latest add liquid-material
Usage
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.
| Name | Type | Default | Description |
|---|---|---|---|
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'. |
gravity | number | 20px | In 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. |
elasticity | number | 0.6 | 0–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. |
depth | number | 50% | 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%. |
frost | number | 20%, 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%. |
highlight | number | 100%, 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%. |
refraction | number | 40px | Glass: how far the edge bends what lies behind it, at its strongest, in px. From 0 to 120px. |
dispersion | number | 30% | Glass: 0–100, how far red, green and blue split where the edge bends, a thin rainbow. From 0 to 100%. |
saturation | number | 1.5 | Glass: 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
Code inputOne box per character for a one-time code, digits or letters, shown or hidden: an autofill taken by a tap rises in as a wave, a wrong code is shaken out of its boxes, and a countdown runs to “send again”.Mobile search flowThe whole of search on a phone: one line, two that fold as you scroll, or two asked step by step. Opens into a fullscreen or sheet search. Fills from your location or picks for you. Loading, error and offline covered.