Skip to main content

Card

A surface container that lifts on a spring and compresses when clickable, with spotlight and tilt effects.

Motion Spec
Pointer-tracked surface and hairline border spotlight with subtle spring lift.
SpotlightCard, stiffness 340, damping 28.
SpotlightCard·pinned:false·applied=0

Customize

Hover lift (px)1.5
Max tilt (deg)5
Press scale0.988
Spring stiffness340
Spring damping28
Speed1

Installation

Add the base component with the registry command:

npx shadcn@latest add @kinetic/card

Install 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-card

Usage

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.

PropTypeDefaultDescription
interactivebooleantrueEnables fine-pointer spring motion, shadow elevation, and press feedback.
hoverLiftPxnumber2.5Upward hover translation in pixels (clamped 0-12). SpotlightCard defaults to 1.5 and TiltCard to 2.
maxTiltDegnumber0Maximum perspective tilt angle in degrees (clamped 0-14). TiltCard defaults to 5.
pressScalenumber0.988Spring compression scale on press when the card is clickable via onClick, role='button', or tabIndex={0} (clamped 0.94-1).
stiffness / dampingnumber340 / 28Spring stiffness (80-900) and damping (8-90) controlling response and settle feel.
speednumber1Spring simulation speed multiplier (clamped 0.25-4).
overlayReact.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.

PropTypeDefaultDescription
...propsOmit<CardProps, "overlay">-Card props.

TiltCard

Card that tilts toward the pointer in perspective, with a sheen that follows it. Accepts the Card props.

PropTypeDefaultDescription
...propsOmit<CardProps, "overlay">-Card props.

CardHeader / CardTitle / CardDescription / CardAction / CardContent / CardFooter

Semantic card layout slots layered cleanly with container-aware CardAction alignment.

PropTypeDefaultDescription
...propsReact.ComponentProps<"div">-Forwards standard div attributes and Tailwind layout class overrides.

Notes

Always compose CardHeader, CardTitle, CardDescription, CardContent, and CardFooter rather than placing headings or actions directly inside CardContent.