Apple Glass Effect

Glassmorphism container with specular highlight, tint controls, and adjustable refraction intensity.

background

Apple Glass Effect wraps any React content in a frosted glass panel rendered with layered CSS backdrop filters, specular highlights, and a subtle refraction gradient. Tint color, distortion strength, and border sharpness are all exposed as props. Built with React and Tailwind CSS. Use it for navigation bars, modals, or cards that need to feel translucent on top of a colored or photographic backdrop.

Installation

Usage

import { GlassContainer } from "@/components/ui/glass-container";
<GlassContainer blur={3} variant="prominent" tint="warm">
  <div className="text-white">Your content here</div>
</GlassContainer>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeRequiredContent to be rendered inside the glass container.
classNamestring""Additional CSS classes to apply.
variant"default" | "prominent" | "regular" | "thin""default"Predefined variants with different blur, opacity, and shadow configurations.
blurnumbervaries by variantBackdrop blur amount in pixels.
opacitynumbervaries by variantOpacity of the glass overlay.
distortion"none" | "subtle" | "medium" | "strong""medium"Glass distortion effect intensity.
tint"neutral" | "warm" | "cool" | "vibrant""warm"Color tint of the glass effect.
borderbooleantrueWhether to show the glass border highlight.
hoverbooleantrueWhether to enable hover effects (scale and shadow).
glassOverlaybooleantrueWhether to apply the tinted glass overlay.
highlightColorstringrgba(255,255,255,0.4)Color of the specular highlights.
highlightOpacitynumber1Opacity of the highlight effect.
innerGlowColorstringrgba(255,255,255,0.1)Color of the inner glow effect.
innerGlowOpacitynumber1Opacity of the inner glow effect.
specularIntensitynumber0.4Intensity of the specular highlights (0-1).