Depth Card
Parallax tilt card with layered glass planes and glare effect on hover.
pnpm dlx @glinui/cli@latest add depth-cardDesign system seats
Move across the card: the badge, price tag and avatar float at different heights above the face.
Installation$
pnpm dlx @glinui/cli@latest add depth-cardPrefer the package?
Usage$
DepthCard is a "use client" component. It tilts based on cursor position with an optional glare effect. Works great for product showcases and interactive cards.
DepthLayer children float at four heights (depth 1 to 4) above the card face. As the card tilts toward the pointer, the avatar, price tag and badge shift against the face, and a glare sheen follows the cursor. autoPlay runs a slow synthetic pointer for touch and screenshots.
Examples$
Variants$
glinr is the default, plain is the flat shadcn look, solid is a neutral tonal face and glass is opt-in. Glass needs a backdrop, so the set below sits on a vivid one.
glinr
Crisp on any stage.
Learn moreplain
Crisp on any stage.
Learn moresolid
Crisp on any stage.
Learn moreglass
Opt-in. Needs a backdrop.
Learn moreimport { DepthCard, DepthLayer } from "@glinui/ui"
// Omit variant to follow the ambient style (glinr by default).export function DepthCardVariants() {return ( <> <DepthCard variant="glinr"> ... </DepthCard> <DepthCard variant="plain"> ... </DepthCard> <DepthCard variant="solid"> ... </DepthCard> <DepthCard variant="glass"> ... </DepthCard> </>)}Colors$
Tones apply through the soft variant, so the face is tinted and the text stays AA.
accent
The effect color follows the tone token.
Learn moresuccess
The effect color follows the tone token.
Learn morewarning
The effect color follows the tone token.
Learn moredanger
The effect color follows the tone token.
Learn moreinfo
The effect color follows the tone token.
Learn moreimport { DepthCard, DepthLayer } from "@glinui/ui"
export function DepthCardTones() {return ( <DepthCard variant="soft" tone="success"> ... </DepthCard>)}In a layout$
Depth cards as metric tiles in a dashboard row.
Overview
Last 7 days// Depth cards as metric tiles in a dashboard row.import { DepthCard, DepthLayer } from "@glinui/ui"
export function DepthCardLayout() {return ( <section className="grid gap-4 sm:grid-cols-3"> ... </section>)}Accessibility$
- The glare overlay is
aria-hidden="true", invisible to assistive technologies. - The card itself is a standard
divwith no implicit role; addroleand keyboard handlers as needed. - Content inside the card remains fully accessible.
Reduced Motion$
When prefers-reduced-motion: reduce is active, the tilt transform is disabled via motion-reduce:transform-none and the glare layer is hidden via motion-reduce:hidden.
API Reference$
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
autoPlay | boolean | No | false | Runs a slow looping synthetic pointer so the tilt, glare and layer parallax are visible without hovering (demos, screenshots, touch). Needs motion level full. A real pointer takes over while hovering. |
glare | boolean | No | true | Glare effect |
glareOpacity | number | No | 0.35 | Glare max opacity |
hoverScale | number | No | 1.02 | Scale on hover |
maxTilt | number | No | 15 | Maximum tilt angle in degrees |
perspective | number | No | 800 | Perspective distance in px |
Source$
import { DepthCard } from "@glinui/ui"Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/depth-card.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
DepthCardProps
DepthCardProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
autoPlay | boolean | No | false | Runs a slow looping synthetic pointer so the tilt, glare and layer parallax are visible without hovering (demos, screenshots, touch). Needs motion level full. A real pointer takes over while hovering. |
glare | boolean | No | true | Glare effect |
glareOpacity | number | No | 0.35 | Glare max opacity |
hoverScale | number | No | 1.02 | Scale on hover |
maxTilt | number | No | 15 | Maximum tilt angle in degrees |
perspective | number | No | 800 | Perspective distance in px |
DepthLayerProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
depth | keyof typeof LAYER_DEPTH | No | 2 | How far the layer floats above the card face (1 closest, 4 highest). |