Skip to content

Glassmorphism Card

Frosted glass profile card in Tailwind CSS with backdrop blur, a light reflection and a follow button over colorful animated gradient blobs.

Tailwind CSS Cards Responsive Dark #card #glassmorphism #gradient #profile #responsive

Live preview

Open in new tab

Code

A glassmorphism profile card built with Tailwind CSS: a frosted, semi-transparent panel floating over a colorful background of blurred gradient blobs. It works well for profile previews, team pages, landing page highlights or any spot where you want a modern, layered look.

How it works

The root is section.tgc-scene, a dark bg-indigo-950 stage with isolate and overflow-hidden. Behind the content sits an aria-hidden layer with three .tgc-blob circles (fuchsia, cyan and amber) softened with blur-3xl, plus two small sharp gradient shapes that make the blur effect behind the glass easy to see.

The card itself is article.tgc-card. The frosted effect comes from Tailwind utilities: bg-white/10 for the translucent fill, backdrop-blur-2xl and backdrop-saturate-150 to blur and boost the colors behind it, and border-white/25 for the bright glass edge. In style.css, a .tgc-card::before gradient adds a diagonal light reflection, and an @supports not rule switches to a more opaque indigo fill when the browser has no backdrop-filter support, so the text stays readable. The blobs drift slowly with the tgc-float keyframes.

Inside the card are an initials avatar, name, location, an "Available" pill, a short bio, a three-column stats list (dl) and two actions. The script runs on DOMContentLoaded for each .tgc-card: clicking [data-tgc-follow] toggles aria-pressed, swaps the label between "Follow" and "Following", switches the plus and check icons with the hidden class, and adds one to the follower number stored in data-tgc-count.

Customization

  • bg-white/10 and backdrop-blur-2xl on .tgc-card: raise the opacity (bg-white/20) or lower the blur (backdrop-blur-md) for a clearer or frostier glass.
  • The color classes on .tgc-blob--a, .tgc-blob--b and .tgc-blob--c (bg-fuchsia-500, bg-cyan-400, bg-amber-300): change them to match your brand palette.
  • bg-indigo-950 on .tgc-scene: set the base color the blobs glow on; a lighter base gives a pastel look.
  • animation-duration on .tgc-blob in style.css: make the drift faster or slower, or remove the animation for a static background.
  • data-tgc-count on the Followers value: set the starting number used by the Follow button.
  • rounded-3xl on the card: use rounded-2xl for tighter corners.

Accessibility

The card is an article labelled by #tgc-name, and the decorative background and avatar are aria-hidden. The Follow control is a button with aria-pressed and a fixed aria-label, so screen readers hear "Follow Jordan Ellis, toggle button, pressed" instead of a changing name; a role="status" region confirms each change. White text sits on a dark, blurred backdrop for strong contrast, and buttons show a white focus-visible outline. Blob motion stops under prefers-reduced-motion, and button transitions use motion-reduce:transition-none.

Usage notes

backdrop-filter needs a colorful or detailed background behind the card to be visible; over a flat color it looks like a plain translucent box. Multiple cards can share a page because the script scopes its queries to each .tgc-card; give each name heading a unique id.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Glassmorphism Card – Tailwind CSS cards component screenshot
Glassmorphism Card · Tailwind CSS Cards

More Cards

Cards with Hover Lift – Pure CSS cards preview

Cards with Hover Lift

Pure CSS blog card grid where each card lifts with a deeper shadow and zooms its image on hover or keyboard focus.

Card with Image Overlay – Bootstrap 5 cards preview

Card with Image Overlay

Bootstrap 5 image cards with text overlaid on photos, a readability gradient, category badges, save buttons and a featured layout.

Blog Post Card – Tailwind CSS cards preview

Blog Post Card

Tailwind CSS blog post card with cover illustration, category badge, date, reading time, clamped excerpt, author row and a fully clickable area.

3D Flip Card – Pure CSS cards preview

3D Flip Card

Three pure CSS 3D flip cards that turn on hover, keyboard focus or tap to reveal details and a link on the back.

Horizontal Card – Bootstrap 5 cards preview

Horizontal Card

Three Bootstrap 5 horizontal cards with the image on the left: an article card, a listing card with rating and price, and a compact course card.