Components

Glass Card

A glassmorphism card for React built with Tailwind CSS and Motion: real backdrop blur and saturation, a 1px hairline border and faint film grain, with optional 3D tilt and a readable fallback where backdrop-filter isn't supported.

  • Backdrop blur
  • Hairline border
  • 3D tilt
  • No re-renders
  • prefers-reduced-motion

Dusk Pass

Business

4291 •••• •••• 0618

Card holder

Ava Lindqvist

Valid thru

12/29

Installation

$ npx shadcn@latest add https://duskui.com/r/glass-card.json

Glass only looks like glass over something colorful. Put the card above an image, gradient or moving shapes — the demos use a small GlassBackdrop of drifting gradient orbs.

Usage

plan-card.tsx
import { GlassCard } from "@/components/dusk/glass/glass-card"

export function PlanCard() {
  return (
    <GlassCard tilt className="max-w-sm">
      <h3 className="font-semibold">Pro plan</h3>
      <p className="text-sm text-white/70">Everything you need to ship.</p>
    </GlassCard>
  )
}

Examples

Profile card

Interactive content works as usual. When something inside the card receives keyboard focus, the hairline border switches to the focus color so the card's edge stays visible.

NK

Noor Khalil(verified)

Motion designer · Lisbon

Components
128
Stars
9.4k
Followers
2.1k

Blur & tint

blur sets the backdrop blur in px and tint takes any translucent CSS color. The default tint is a smoky mix of the page background, which keeps white text readable over bright colors.

Light

blur=4

Higher blur hides more of what sits behind the card.

Frosted

blur=14

Higher blur hides more of what sits behind the card.

Milky

blur=28

Higher blur hides more of what sits behind the card.

API Reference

Also accepts every <div> prop. Padding defaults to p-6; override it with className.

PropTypeDefaultDescription
blurnumber16Backdrop blur in px.
saturationnumber140Backdrop saturation in percent. Above 100 makes colors behind the glass richer.
tintstring"color-mix(in oklab, var(--background) 35%, transparent)"Glass fill. Any translucent CSS color.
tiltboolean | numberfalse3D tilt towards the pointer. true = 8°, or pass the max angle.
noisebooleantrueSubtle film-grain texture on the glass.

Accessibility

  • Decorative layers (grain, border) are aria-hidden and ignore the pointer, so the card's content is exactly what assistive tech reads.
  • Where backdrop-filter isn't supported the card falls back to an almost opaque fill, so text contrast never depends on the blur.
  • A visible focus-colored edge appears when anything inside the card has keyboard focus.
  • Tilt is disabled for touch input and when the user prefers reduced motion; it runs on motion values and never re-renders.