Skip to content
← All articles

Tutorials ·

Frosted glass cards in React with blur and inset highlights

UI Layouts

On this page

The rounded tiles in this mobile control grid share a blurred backdrop. Watch the wallpaper between two tiles. It stays sharp in the gap and softens under each icon.

Inspect the mobile controls

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

Keep the content above the blur

The Glassmorphism component draws a backdrop-blur layer, an outer shadow, and an inset highlight. The blur layer also has an SVG turbulence filter that gently distorts the background. Position your content above these layers with relative z-30 so the icon and type stay crisp.

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

export function WeatherCard() {
  return (
    <Glassmorphism
      draggable={false}
      borderRadius="24px"
      blurIntensity="md"
      shadowIntensity="sm"
      className="w-56 bg-slate-950/65 text-white"
    >
      <div className="relative z-30 p-5">
        <p>Berlin</p>
        <p className="text-3xl">18°C</p>
      </div>
    </Glassmorphism>
  );
}

Place the card over a photograph or patterned background to give the blur some detail to soften. The translucent dark fill keeps the white text visible over light areas. Try the brightest section of your own background and adjust the fill as needed.

Adjust the rim independently

Raise blurIntensity to soften detail behind the text. Use shadowIntensity to set the inset highlight that traces the edge and glowIntensity to adjust the outer shadow. On a grid, the shadow falls into the gap between tiles, so check the result at the spacing the controls will actually use.

Explore the Glassmorphism examples and source.