Holo Card
motiq/holo-cardFreeComponent
A 3D tilt card that behaves like a physical foil pass: twin underdamped springs (k=120, d=10) chase the pointer so the card lags and overshoots ~6% on release, while the specular glare and iridescent conic foil stay pinned to the raw pointer — light is instant, mass is not. Counter-moving ground shadow, arrow-key tilt, touch drag, reduced-motion resting pose, offscreen-paused.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/holo-card.jsonSource
1"use client";23import * as React from "react";45import { cn } from "@/lib/utils";6import { useReducedMotion, useVisibilityPause } from "@/lib/motiq";78/* -------------------------------------------------------------------------- */9/* Types */10/* -------------------------------------------------------------------------- */1112export type HoloCardFoil = "azure" | "spectral" | "none";1314export interface HoloCardProps extends React.HTMLAttributes<HTMLDivElement> {15 /** Card content. Laid out as a full-height column so a header/mid/footer trio reads like a pass. */16 children?: React.ReactNode;17 /** Peak lean in degrees at the card edge. 14 reproduces the lab's ±11° / ±15° pair. */18 maxTilt?: number;19 /** Tilt spring. Deliberately underdamped (ζ≈0.46) so release overshoots ~6% once. */20 spring?: { stiffness?: number; damping?: number };21 /** Iridescent foil sheet pinned to the raw pointer. */22 foil?: HoloCardFoil;23 /** Specular glare hotspot. */24 glare?: boolean;25 /** Counter-moving ground shadow under the card. */26 shadow?: boolean;27 /** Ambient sway before/after any pointer input. */28 idleSway?: boolean;29 /** Card aspect ratio (width / height). Pass 0 to let the content size the card. */30 aspect?: number;31 /** Accessible name for the tilt surface. */32 label?: string;33 /** Fires with the settled spring angles (rotateX, rotateY) as they change. */34 onTilt?: (rx: number, ry: number) => void;35 /** Park the loop while scrolled offscreen or the tab is hidden. */36 pauseWhenHidden?: boolean;37 /** Force the static, motion-free resting pose regardless of system preference. */38 reducedMotion?: boolean;39}4041/* -------------------------------------------------------------------------- */42/* Physics */43/* -------------------------------------------------------------------------- */4445/** Hand-rolled delta-time spring — keeps the component dependency-free. */46class Spring {47 x: number;48 v = 0;49 target: number;50 k: number;51 d: number;52 constructor(value: number, k: number, d: number) {53 this.x = value;54 this.target = value;55 this.k = k;56 this.d = d;57 }58 step(dt: number): number {59 const a = this.k * (this.target - this.x) - this.d * this.v;60 this.v += a * dt;61 this.x += this.v * dt;62 return this.x;63 }64}6566// … truncated
What it pulls in
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
