Glass Card
Frosted glass card with subtle border and blur.
Glass card
Frosted glass effect with backdrop blur. Looks best over a colorful background.
<div class="max-w-sm rounded-3xl border border-white/40 bg-white/20 backdrop-blur-xl p-6 shadow-xl"> <h3 class="text-lg font-bold text-slate-900 dark:text-white">Glass card</h3> <p class="mt-2 text-sm text-slate-600 dark:text-slate-300">Frosted glass effect with backdrop blur. Looks best over a colorful background.</p> <button class="mt-4 px-4 py-2 rounded-xl bg-slate-900 text-white text-sm font-semibold">Action</button> </div>
Free to use in personal and commercial projects. No attribution required.
Variants
Same component, different looks. Preview each one live and copy the code you like.
Dark glass
Dark frosted glass for media overlays and night mode panels.
Glass card
Frosted dark glass for overlays on photos and video backgrounds.
Profile
Profile layout showing glassmorphism on people cards and team grids.
Jane Doe
Product Designer
Indigo tint
Brand tinted glass when plain frosted white feels too neutral.
Glass card
A tinted glass variant that carries your brand color through the frost.
Where to use it
- ✓ Hero overlays
- ✓ Music player widgets
- ✓ Notification panels
- ✓ Login cards over imagery
About this glass card
Glassmorphism is the frosted-glass look: translucent panels with backdrop blur floating over colorful backgrounds. This glass card uses bg-white/20 with backdrop-blur-xl and a subtle white border, the classic glass recipe.
The effect only works over something interesting. On a flat background, glass looks like a dirty white panel. Place it over gradients, images, or mesh backgrounds where the blur has something to refract. Our Mesh Gradient tool generates perfect backdrops.
Glass cards suit overlays, not primary content. Text on glass needs careful contrast; keep it for short labels and actions, not paragraphs. The 20% white fill keeps text readable while the blur sells the effect.
Cards floating over busy backgrounds (photography, gradients, video) face two bad options: solid white boxes that look pasted on, or transparent panels where the text drowns in the background. Glassmorphism is the third option. The panel stays readable while the blurred background shows through, so the card feels like part of the scene instead of a sticker slapped on top. That is why it rules overlays and rarely works as a page background.
Four properties cooperate to make the glass. bg-white/20 gives the translucent fill, while backdrop-blur-xl blurs whatever sits behind the element (never the element's own content). border-white/40 draws the bright edge that sells the glass illusion, and shadow-xl lifts the panel off the surface. Remove any one of them and the effect collapses: no blur reads as plain translucency, no border reads as a smudge.
Over dark imagery, flip the recipe to dark glass: bg-slate-900/40 with a border-white/10 edge and light text. Push to backdrop-blur-2xl when the backdrop is high-detail photography that needs stronger frost to calm down. When the backdrop is subtle, drop the fill to bg-white/10 so the panel does not look milky.
The mistake is putting interactive overlays inside the glass card. The backdrop-filter property creates a new containing block and stacking context, so position: fixed children (dropdowns, tooltips, date pickers) inside the card get clipped or mispositioned instead of floating free. If a glass panel needs a dropdown, render the overlay in a portal outside the card, or skip the glass on that panel entirely.
Frequently asked questions
How do I make glassmorphism in Tailwind?
Combine bg-white/20 (translucent fill), backdrop-blur-xl (frost), and border-white/40 (edge definition). Place over a colorful background or the effect is invisible.
Why does my glass card look flat?
Two common causes: the background behind it is flat (glass needs color to refract), or the border is missing (the edge defines the glass).
Is glassmorphism accessible?
Text on glass can fail contrast. Keep glass for short text and test contrast ratios. Provide solid fallbacks where readability is critical.
Why is backdrop-blur not working in Safari?
Older Safari versions need the -webkit-backdrop-filter prefix. Tailwind's backdrop-blur utilities output the standard property, so add -webkit-backdrop-filter: blur(...) in your CSS for Safari support. Current Safari handles the unprefixed property, so this mainly matters for older versions.
How do I make a dark glassmorphism card?
Swap the white tint for a dark one: bg-slate-900/40 with backdrop-blur and a border-white/10 edge, then use light text. Dark glass looks best over colorful or photographic backgrounds, just like light glass does. Test the text contrast, since frosted backgrounds can wash out thin text.
Does backdrop-filter hurt scrolling performance?
It can. backdrop-filter forces the browser to re-render everything behind the element, so a page full of glass cards over busy backgrounds may scroll less smoothly, especially on mobile. Use glass sparingly, keep the blur radius modest, and avoid animating the position of large glass surfaces.
Design notes
When to use
Use it for overlays floating over something visually rich: hero panels over imagery, music player widgets, and login cards over gradients. The frosted blur only works when there is something interesting behind it to refract. Keep the content short, labels and actions, not paragraphs.
What to avoid
Do not place it over a flat solid background, where it looks like a dirty white panel instead of glass. Do not put long paragraphs on glass; text contrast over a blurred backdrop is fragile and hard to guarantee.
Accessibility
Text contrast over glass depends on whatever sits behind it, so test contrast against your actual backdrops and keep a solid-background fallback where backdrop-filter is unsupported. Keep text large and bold to survive the blur.
Customization tips
Increase blur with backdrop-blur-2xl for more frost. Adjust bg-white/10 to /30 for transparency. The border-white/40 edge is essential; without it the glass looks flat.
Customize it with our tools
Related elements
Hover lift card
Subtle lift plus shadow sells interactivity without layout shift.
Hover Lift Card
Card that lifts with a deepening shadow on hover.
Revenue
$48.2k
12.4%
Stat Card
Metric card with trend indicator.
Gradient border
A 2px gradient frame makes any card feel premium.
Gradient Border Card
Card with a gradient border frame.