Skip to content

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.

Installation

npx uilayouts@latest add glassmorphism

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.

import { Glassmorphism } from '@/components/ui/glassmorphism';

export function FrostedCard() {
  return (
    <Glassmorphism width="280px" borderRadius="24px" blurIntensity="md">
      <div className="relative z-30 p-6">Weather in Berlin</div>
    </Glassmorphism>
  );
}
PropPurpose
blurIntensitySelect the backdrop blur from sm, md, lg or xl. Defaults to xl.
borderRadiusSet the corner radius. Defaults to 32px.
glowIntensity, shadowIntensitySet the outer glow and inset highlight from none through 2xl.
draggableEnable elastic drag. Defaults to true.
expandableToggle between the resting and expanded dimensions on click. Defaults to false.
width, height, expandedWidth, expandedHeightSet CSS dimensions for each state.

Weather

16:00+18°
17:00+18°
18:00+16°
19:00+14°
20:00+15°
21:00+14°
+18°C
Cloudy +18°/+5°
17:32
Sun, November 19
Tue, 7 Sep
+18°/+4°
Wed, 8 Sep
+20°/+6°
Thu, 9 Sep
+17°/+3°
Fri, 10 Sep
+22°/+10°
Sat, 11 Sep
+16°/+5°

Mobile icons

Rotation Lock
Notifications
Brightness
Mute Volume
FocusFocus Mode
Flashlight
Timer
Camera
Record Screen

Notification

UI-Layouts
New components are available for you
Glassmorphism
12:34
UI Layouts component collection
New components are available for you
12:34