Card
A card made of frosted glass. Your content sits on it; its face blurs and tints whatever lies behind so the text stays readable, and its rim pulls it towards the centre.
glass-card-basic.tsx
Istanbul
16°
Cloudy
H:19° L:15°
Use it for
- A small surface of content over colour, imagery or motion: a widget, a now-playing card, a summary.
- One or two cards, where what is behind them is part of the design.
Not for
- Long text and forms: the backdrop shows through. Use a plain card.
- A card on a flat background: there is nothing to bend.
- One clickable action: use GlassButton.
Installation
Coming soon
npm install @vitrumui/reactNo dependencies
Usage
app.tsx
import { GlassCard } from '@vitrumui/react/card'
<GlassCard className="w-64 p-5">
<p className="font-semibold">Wednesday</p>
<p className="text-sm opacity-60">Design review · 10:00</p>
</GlassCard>
// Something moves behind it: repaint what it bends every frame.
<GlassCard live className="size-44 p-4">…</GlassCard>
// Clearer glass: no frost, less tint.
<GlassCard blur={0} tint={0.3} className="w-64 p-5">…</GlassCard>Examples
Coming soon
API reference
| Prop | Type | Default |
|---|---|---|
childrenThe card's content. | ReactNode | — |
materialClear bends what is behind; tinted uses the background colour. | 'clear' | 'tinted' | 'clear' |
tintClear glass only: how much tint covers the backdrop (0–1): white on a light page, black on a dark one. | number | 0.7 |
blurClear glass only: how much the backdrop is frosted, in px like CSS | number | 5 |
liveRepaint the backdrop every frame, for content that moves behind the card. | boolean | false |
classNameSize, padding, corners ( | string | — |
…restPassed to the | div attributes | — |
Accessibility
- A plain
<div>: when the card stands for one thing, name it (role="group"with anaria-label). - The glass canvas is
aria-hidden; only your content is read. - Content that moves behind it should respect reduced motion: the rows above stop.