Card3D
A card with 3D perspective tilt that follows the mouse cursor. Pure CSS/JS — does not require Three.js. Includes an optional glare overlay effect.
Basic
Hover over the cards to see the 3D tilt and glare effect.
import { Card3D } from "@mantleui/react/three";
<Card3D maxTilt={15} glare> <div style={{ width: 280, padding: 16 }}> <h3>Component Library</h3> <p>73 production-grade components.</p> </div></Card3D>
// Custom colors<Card3D borderColor="#8b5cf640" background="rgba(139, 92, 246, 0.05)"> <div>Purple tinted card</div></Card3D>
// Stronger tilt<Card3D maxTilt={25}> <div>More dramatic tilt effect</div></Card3D>No Glare
Subtle tilt without the glare overlay — great for minimal designs.
// No glare, subtle tilt<Card3D glare={false} maxTilt={8} borderColor="#3b82f640" background="rgba(59, 130, 246, 0.04)"> <div> <h3>Pro Plan</h3> <p>$19/month</p> <ul> <li>Unlimited projects</li> <li>Priority support</li> </ul> </div></Card3D>FlipCard
A card that flips on click to reveal a back side. Supports horizontal and vertical flip directions.
Click to Flip
Click on any card to see the flip animation.
import { FlipCard } from "@mantleui/react/three";
// Basic horizontal flip<FlipCard width={300} height={220} frontBackground="#18181b" backBackground="#18181b" borderColor="#27272a" front={ <div style={{ padding: 24, textAlign: "center" }}> <h3>Front Side</h3> <p>Click to flip</p> </div> } back={ <div style={{ padding: 24, textAlign: "center" }}> <p>Back side content here</p> </div> }/>
// Gradient backgrounds<FlipCard frontBackground="linear-gradient(135deg, #0ea5e9, #7c3aed)" backBackground="linear-gradient(135deg, #7c3aed, #f43f5e)" borderColor="transparent" front={<div>Front</div>} back={<div>Back</div>}/>
// Vertical flip<FlipCard direction="vertical" front={<div>Flips top to bottom</div>} back={<div>Back content</div>}/>
// Controlledconst [flipped, setFlipped] = useState(false);<FlipCard flipped={flipped} onFlippedChange={setFlipped} front={<div>Controlled front</div>} back={<div>Controlled back</div>}/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Card content. |
maxTilt | number | 15 | Max tilt angle in degrees. |
perspective | number | 1000 | CSS perspective distance in pixels. |
resetSpeed | number | 400 | Transition speed (ms) when mouse leaves. |
hoverScale | number | 1.02 | Scale factor on hover. |
glare | boolean | true | Enable glare overlay effect. |
maxGlare | number | 0.15 | Maximum glare opacity (0-1). |
borderColor | string | "var(--mantle-color-border)" | Border color. |
background | string | "var(--mantle-color-bg-subtle)" | Background color. |
borderRadius | string | number | 12 | Border radius in pixels or CSS value. |
childrenReactNodeCard content.
maxTilt15numberMax tilt angle in degrees.
perspective1000numberCSS perspective distance in pixels.
resetSpeed400numberTransition speed (ms) when mouse leaves.
hoverScale1.02numberScale factor on hover.
glaretruebooleanEnable glare overlay effect.
maxGlare0.15numberMaximum glare opacity (0-1).
borderColor"var(--mantle-color-border)"stringBorder color.
background"var(--mantle-color-bg-subtle)"stringBackground color.
borderRadius12string | numberBorder radius in pixels or CSS value.