Tilt Card
ComponentsTilt Card
Cards

Tilt Card

A gentle shift in perspective that makes a flat card feel like an object.

React + CSS
ANTICRAFTDIGITAL OBJECTS
COLLECTION 001
A different
perspective.
Move around. See it differently.
Live component. Go ahead, interact.
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/tilt-card.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { TiltCard } from '@/components/anticraft/TiltCard';

export function Example() {
  return (
    <TiltCard maxRotation={8} perspective={900} style={{ padding: '2rem' }}>
      <h3>A different perspective.</h3>
      <p>Small details. A deeper impression.</p>
    </TiltCard>
  );
}
03

Props

PropTypeDefaultDescription
childrenReactNode—The contents of the dimensional card.
maxRotationnumber8Maximum rotation in degrees, clamped between 0 and 30.
perspectivenumber900Viewer distance in pixels, with a minimum of 100.
classNamestring''Additional classes for the card.
styleCSSProperties—Inline styles and CSS custom properties. Native div attributes are supported.
04

Motion & accessibility

Considered by default.

Tilts only with mouse input and returns to center when the pointer leaves. Reduced motion, coarse pointers, and devices without hover keep the card flat.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.