Liquid Glass
An advanced, Apple-style chromatic aberration and displacement effect using complex SVG filters for stunning refractions.
Installation
npx raya-ui@latest add liquid-glassFile Structure
your-project
components
ui
liquid-glass
LiquidGlass.vue
API Reference
Props
radiusnumber16Border radius of the glass container in pixels.
scalenumber-180Intensity of the SVG displacement map (refraction strength).
blurnumber11Blur amount for the internal displacement filter map.
alphanumber0.93Opacity of the internal feColorMatrix shape mask.
lightnessnumber30Controls the specular lighting brightness on the edges.
GLASS
EFFECT
Balance
$12,450.00
Drag the card to see the refraction
Settings
-40
15px
30
0.93
24px
source-code.vue
<script setup lang="ts">
import { LiquidGlass } from '@/components/ui/liquid-glass'
</script>
<template>
<LiquidGlass class="w-72 h-48"
:radius="24"
:scale="-40"
:blur="15">
<div class="h-full w-full flex items-center justify-center p-6 bg-white/5">
<p class="text-white font-medium">Refracted Content</p>
</div>
</LiquidGlass>
</template>