GlassCard

Renders a glassmorphism card with 3D tilt effect and dynamic glare on mouse movement.

Preview/Playground

Created by
Creator
Barsan

Feature Title

Category

Description text

Astro Astro
import GlassCard from '@astroanimate/core/GlassCard';

<GlassCard
  title="Feature Title"
  subtitle="Category"
  description="Description text"
  icon="<svg>...</svg>"
  enableTilt={true}
/>

Installation

bash
npm install @astroanimate/core

Usage

---
import GlassCard from "@astroanimate/core/GlassCard";
---

<GlassCard
  title="Feature Title"
  subtitle="Category"
  description="Description text"
  icon="<svg>...</svg>"
  enableTilt={true}
/>

Displays a styled card with glass effect and optional 3D tilt interaction.

Props

Prop Type Default Description
titlestring"Glassmorphism UI"Card title text
subtitlestring"A New Design Trend"Card subtitle text
descriptionstringLong default textCard description text
iconstringSVG icon stringIcon as SVG string or image URL
iconColorstringLinear gradientBackground color for icon container
backgroundColorstringrgba(255, 255, 255, 0.1)Card background color
borderColorstringrgba(255, 255, 255, 0.2)Card border color
containerBackgroundstring"white"Container background color
tiltIntensitynumber10Maximum tilt angle in degrees
enableTiltbooleantrueEnable/disable 3D tilt effect
titleColorstring"#ffffff"Title text color
subtitleColorstring"#a5b4fc"Subtitle text color
descriptionColorstringrgba(255, 255, 255, 0.7)Description text color
classstring""Additional CSS classes
stylestring""Additional inline styles
ariaLabelstringtitle valueARIA label for accessibility

Use When

  • Displaying feature cards with glassmorphism design
  • Creating interactive UI elements with 3D effects
  • Building modern, futuristic card layouts

Avoid When

  • Needing static cards without animation
  • Targeting browsers without backdrop-filter support
  • Requiring complex nested content beyond title/subtitle/description

Accessibility

  • Supports ariaLabel prop for screen readers
  • Respects prefers-reduced-motion media query to disable transitions
  • Falls back to title when ariaLabel is not provided

Performance

  • Uses CSS transforms for smooth 60fps animations
  • JavaScript event listeners only added when enableTilt is true

Credits