Skip to content
PixiKit

Lean Card

A photo card that tilts in 3D toward the cursor with glare, a shifting shadow, floating layers, a caption tag that follows the pointer and a back side it flips to on click.

pixikit.com/docs/components/lean-card

Customize

Show tooltip
Display overlay content
Overlay depth30px
Flip on click
Rotate amplitude12°
Scale on hover1.05
Perspective800px
Radius15px
Smoothness0.60
Glare0.50
Glare color
Shadow0.50
Parallax1.0
Axis
Reverse
Track window
Floating
Gyroscope
Intro
Intro delay0ms

Props

35
NameTypeDefaultDescription
imageSrcstringNonePhoto that fills the card.
altTextstring"Tilted card image"Alternative text for the photo.
childrenReactNodeNoneContent on the face of the card, over the photo or instead of it.
captionTextstring""Text in the small tag that follows the cursor and swings as it moves.
showTooltipbooleantrueShows the caption tag on hover.
overlayContentReactNodenullContent that floats in front of the card, lifted off its surface.
displayOverlayContentbooleanfalseShows the overlay content.
overlayDepthnumber30How far the overlay floats in front, in px.
backContentReactNodenullContent for the back of the card. Clicking, tapping or pressing Enter flips the card over.
flipOnClickbooleantrueFlips the card when it is clicked. Needs backContent.
flippedbooleanNoneControls which side shows. Leave it unset to let clicks flip the card.
onFlip(flipped: boolean) => voidNoneCalled with the new side whenever the card is flipped.
onClick(event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>) => voidNoneCalled when the card is clicked or activated with the keyboard.
containerWidthnumber | string"100%"Width of the area that reacts to the cursor.
containerHeightnumber | string"300px"Height of the area that reacts to the cursor.
imageWidthnumber | string"300px"Width of the card.
imageHeightnumber | string"300px"Height of the card.
rotateAmplitudenumber12How far the card tilts toward the cursor, in degrees.
scaleOnHovernumber1.05How much the card grows when hovered.
perspectivenumber | string800Viewing distance in px. Lower values give a stronger 3D effect.
radiusnumber | string15Corner radius of the card.
smoothnessnumber0.6From 0 to 1. Low values snap to the cursor, high values glide and settle with a soft bounce.
glarenumber0.5Strength of the light that catches the surface and edges as the card tilts, from 0 to 1.
glareColorstring"#ffffff"Color of the glare.
shadownumber0.5Strength of the soft shadow under the card, which shifts and grows as the card lifts, from 0 to 1.
parallaxnumber1How far layers and the photo shift with the tilt. 0 keeps everything flat.
axis"both" | "horizontal" | "vertical""both"Limits the tilt to following the cursor left and right, or up and down.
reversebooleanfalseTilts away from the cursor instead of toward it.
trackWindowbooleanfalseThe card follows the cursor anywhere on the page, not only while hovered.
floatingbooleanfalseThe card drifts and sways gently while idle.
gyroscopebooleantrueTilts the card as a phone or tablet is moved. Asks for permission on iOS on the first tap.
introbooleantrueThe card rises and settles into place when it first scrolls into view.
introDelaynumber0Wait before the intro, in ms. Stagger it across a row of cards.
classNamestring""Extra class names for the card.
styleCSSPropertiesNoneInline styles for the card.

More media components in Pro

View all

Related