Glassmorphism
A frosted glass card with adjustable blur, inset highlights, elastic dragging and expandable dimensions.
Use Glassmorphism for a frosted panel over a busy background. You can adjust its blur and highlights or let the panel expand on click. For a lens that bends an image at its edges, see Liquid Glass.
Sidebar menu
Installation
Usage
With the UI Layouts CLI, import from @/components/uilayouts/glassmorphism. The example below uses the shadcn install path, @/components/ui/glassmorphism. The component uses the cn helper from @/lib/utils.
| Prop | Purpose |
|---|---|
blurIntensity | Select the backdrop blur from sm, md, lg or xl. Defaults to xl. |
borderRadius | Set the corner radius. Defaults to 32px. |
glowIntensity, shadowIntensity | Set the outer glow and inset highlight from none through 2xl. |
draggable | Enable elastic drag. Defaults to true. |
expandable | Toggle between the resting and expanded dimensions on click. Defaults to false. |
width, height, expandedWidth, expandedHeight | Set CSS dimensions for each state. |
