Liquid Lens
The SVG displacement filter that data-theme="liquid" refracts floating UI through, rendered only where backdrop-filter can use it.
Example
- Northern lights3:10
- Glass harbour4:14
- Slow tide5:18
- Paper moons3:22
- Copper wire4:26
- Quiet engines5:30
- Salt and cedar3:34
- Late trains4:38
- Blue hour5:42
- Open water3:46
PreviousPlayNextCopy linkShare
liquid-lens-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
Render one <LiquidLens /> in a page that uses data-theme="liquid", so floating UI refracts what is behind its edges in Chromium.
API reference
LiquidLens
| Prop | Type | Default |
|---|---|---|
refractionHow far the edges shift what's behind, as a fraction of the element's size: 0 is flat glass. Defaults to 0.08. | number | 0.08 |
Other exports
liquidLensIdtype LiquidLensPropsAccessibility
- Hidden from assistive tech: it draws nothing itself, only the filter the theme's backdrop references.
- Under prefers-reduced-transparency, data-elevation="flat" or without backdrop-filter, floating UI is opaque and the lens is off.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.