Xzero UI
Pro library

Glass cardPro

A glass info panel over a photo whose rim catches a pointer-following highlight while the card tilts; tap to morph it into a detail sheet.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/glass-card
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/glass-card

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { GlassCard } from "@/components/xzero/glass-card/glass-card";

export function Host() {
  return (
    <GlassCard image="/people/jasmine.jpg" imageAlt="Portrait of Jasmine Brooks" title="Jasmine Brooks" subtitle="Design lead, Lisbon" aside="4.9">
      <p>Leads design systems at Meridian.</p>
      <button type="button">Follow</button>
    </GlassCard>
  );
}

API reference

GlassCard

A photo card with a glass info panel. The panel's rim catches a specular highlight under the pointer, the card tilts a few degrees toward it, and a tap morphs the panel up into a detail sheet.

PropTypeDefaultDescription
image (required)string–Photo behind the glass.
imageAlt (required)string–Alt text for the photo. Pass an empty string when it is decorative.
title (required)string–Main line in the glass panel, such as a name or a product.
subtitleReactNode–Second line under the title.
asideReactNode–Small element at the end of the header, such as a price, a rating, or a status.
childrenReactNode–Detail content revealed when the card expands. Buttons inside stay interactive and do not toggle the card.
openboolean–Controlled expanded state.
defaultOpenbooleanfalseInitial expanded state when uncontrolled.
onOpenChange(open: boolean) => void–Called when the card expands or collapses.
tiltnumber6Maximum tilt in degrees. 0 turns tilt off.
classNamestring–Extra class on the card. Set its width here; the card keeps a 4 by 5 ratio.
styleCSSProperties–Inline style on the card.

Keyboard interactions

KeysAction
TabMoves to the header button, then into the detail content when open.
Enter / SpaceOn the header, expands or collapses the card.
EscapeCollapses the card and returns focus to the header.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in glass

Guidance for AI tools

Glass card: A glass info panel over a photo whose rim catches a pointer-following highlight while the card tilts; tap to morph it into a detail sheet. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components