Card
A surface container that lifts on a spring and compresses when clickable, with spotlight and tilt effects.
Customize
Installation
Add the base component with the registry command:
npx shadcn@latest add @kinetic/cardInstall an effect separately when you need it. Each command also installs the base card.
npx shadcn@latest add @kinetic/spotlight-card
npx shadcn@latest add @kinetic/tilt-cardUsage
Compose the card from its header, content and footer parts:
import { Button } from "@/components/kinetic/ui/button";
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/kinetic/ui/card";
export function PlanCard() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle>Studio plan</CardTitle>
<CardDescription>Billed monthly</CardDescription>
<CardAction>
<Button variant="ghost" size="sm">Manage</Button>
</CardAction>
</CardHeader>
<CardContent>5 seats, unlimited projects.</CardContent>
<CardFooter>Renews Dec 1</CardFooter>
</Card>
);
}Spotlight
Use SpotlightCard for a soft glow and a lit border edge that follow the pointer.
import { SpotlightCard } from "@/components/kinetic/ui/spotlight-card";
<SpotlightCard>...</SpotlightCard>Tilt
Use TiltCard to tilt the card toward the pointer in perspective, with a sheen. maxTiltDeg sets the angle (5 by default).
import { TiltCard } from "@/components/kinetic/ui/tilt-card";
<TiltCard maxTiltDeg={8}>...</TiltCard>Every effect accepts the same props as Card.
Lift and press
On hover the card rises by hoverLiftPx. A card with onClick or a button role compresses to pressScale while pressed; nested buttons do not trigger it. Tune the spring with stiffness and damping.
<Card hoverLiftPx={4} onClick={openPlan}>...</Card>Static card
Set interactive={false} to turn off every pointer effect, for example on cards inside a carousel.
<Card interactive={false}>...</Card>Custom overlay
Pass layers through overlay to build your own effect. While the pointer is over the card it sets --card-pointer-x, --card-pointer-y (percent) and --card-glow (0 to 1).
<Card
overlay={
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 rounded-[inherit]"
style={{
opacity: "var(--card-glow, 0)",
background:
"radial-gradient(240px circle at var(--card-pointer-x) var(--card-pointer-y), var(--accent), transparent 70%)",
}}
/>
}
>
...
</Card>Motion preferences
Pointer effects run only for a fine pointer. Use speed to scale the springs. Reduced motion turns off the lift, press, glow and tilt.
API Reference
Card
Surface container with a spring hover lift and press compression. It exposes --card-pointer-x, --card-pointer-y and --card-glow to layers passed through overlay.
| Prop | Type | Default | Description |
|---|---|---|---|
interactive | boolean | true | Enables fine-pointer spring motion, shadow elevation, and press feedback. |
hoverLiftPx | number | 2.5 | Upward hover translation in pixels (clamped 0-12). SpotlightCard defaults to 1.5 and TiltCard to 2. |
maxTiltDeg | number | 0 | Maximum perspective tilt angle in degrees (clamped 0-14). TiltCard defaults to 5. |
pressScale | number | 0.988 | Spring compression scale on press when the card is clickable via onClick, role='button', or tabIndex={0} (clamped 0.94-1). |
stiffness / damping | number | 340 / 28 | Spring stiffness (80-900) and damping (8-90) controlling response and settle feel. |
speed | number | 1 | Spring simulation speed multiplier (clamped 0.25-4). |
overlay | React.ReactNode | - | Layers painted over the surface. They can read the pointer and glow CSS variables. |
SpotlightCard
Card with a soft glow and a lit border edge that follow the pointer. Accepts the Card props.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Omit<CardProps, "overlay"> | - | Card props. |
TiltCard
Card that tilts toward the pointer in perspective, with a sheen that follows it. Accepts the Card props.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Omit<CardProps, "overlay"> | - | Card props. |
CardHeader / CardTitle / CardDescription / CardAction / CardContent / CardFooter
Semantic card layout slots layered cleanly with container-aware CardAction alignment.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | React.ComponentProps<"div"> | - | Forwards standard div attributes and Tailwind layout class overrides. |