Overview
Perspective tilt that follows the cursor. Drop in any content block — profile, feature, or callout.
Installation
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| children | React.ReactNode | Yes | — | Content to be rendered inside the 3D card. |
| className | string | No | — | Optional custom class names for styling. |
| intensity | number | No | 0.4 | 0–1 tilt factor across the card surface. 0.4 ≈ 10° at the edges. |
| depth | number | No | 60 | Pop-out distance (px) for inner content parallax. |
| border | boolean | No | true | Toggles the border around the card. |
Example
Accessibility
The 3D Card follows accessibility best practices:
-
Reduced Motion — Animations respect prefers-reduced-motion.
-
Keyboard Friendly — Fully accessible with tab navigation.
-
Screen Reader Support — Uses semantic HTML for inner content.
-
Focus Indicators — Maintains visible focus states even with transforms applied.
Performance Tips
Use Hardware Acceleration — CSS transforms automatically offload to the GPU.
-
Limit Depth — Too much z-distance can trigger motion sickness.
-
Optimize Renders — Memoize content inside the card to avoid re-renders.
-
Touch Devices — Consider disabling tilt on mobile or use gentle touch parallax.