Google Gemini Effect3D Card EffectSparklesBackground GradientSpotlightImages SliderHero ParallaxWavy BackgroundGlowing StarsText Reveal CardEvervault CardAnimated TooltipFollowing PointerBackground BeamsSVG Mask EffectInfinite Moving CardsGrid and Dot Backgrounds3D PinParallax ScrollTracing BeamContainer Scroll AnimationText Generate EffectMeteorsCard StackMoving BorderLamp effectCard Hover EffectSticky Scroll RevealLayout GridDirection Aware HoverFloating NavbarNavbar MenuTabsTailwind CSS buttonsGradient AnimationBento GridTypewriter EffectBackground Boxes
A card perspective effect, hover over the card to elevate card elements.
Make things float in air
Hover over this card to unleash the power of CSS perspective
Installation
Install dependencies
npm i framer-motion clsx tailwind-mergeAdd util file
utils/cn.ts
import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}Copy the source code
components/ui/3d-card.tsx
Examples
With rotation
Make things float in air
Hover over this card to unleash the power of CSS perspective
Props
CardContainer
Prop | Type | Description |
children | React.ReactNode | The child elements to be rendered within the container. |
className | string | The CSS class to be applied to the container. |
containerClassName | string | The CSS class to be applied to the outer container. |
CardBody
Prop | Type | Description |
children | React.ReactNode | The child elements to be rendered within the body. |
className | string | The CSS class to be applied to the body. |
CardItem
Prop | Type | Description |
as | React.ElementType | The HTML tag to be used for the item. Defaults to "div". |
children | React.ReactNode | The child elements to be rendered within the item. |
className | string | The CSS class to be applied to the item. |
translateX | number or string | The X translation of the item. |
translateY | number or string | The Y translation of the item. |
translateZ | number or string | The Z translation of the item. |
rotateX | number or string | The X rotation of the item. |
rotateY | number or string | The Y rotation of the item. |