Vanilla Tilt Card

The Vanilla Tilt Card component is a card component that uses the Vanilla Tilt library to create a 3D tilt effect.

John Lennon

John Lennon

Usage

Follow the steps below to add the Vanilla Tilt Card Component to your project.

1

Add the import statement for the component

import {VanillaTiltCard} from "@/components/elixir-ui/vanilla-tilt-card"; 

2

Import the component in your project and use it

<div className="flex h-full w-full items-center justify-center">
  <VanillaTiltCard className="flex w-fit flex-col">
    <Image
      src="/components/john-lennon.jpg"
      alt="John Lennon"
      width={1000}
      height={1000}
      className="aspect-auto h-60 w-60 rounded-lg border object-cover"
    />
    <h1 className="mt-2 rounded-lg bg-black p-2 text-center text-xl font-semibold text-white uppercase dark:bg-white/5 dark:text-white">
      John Lennon
    </h1>
  </VanillaTiltCard>
</div>

Props

PropTypeDefaultDescription
optionsobject-The options for the Vanilla Tilt Card
options.maxnumber5The maximum tilt intensity
options.speednumber300The speed of the tilt
options.glarebooleantrueWhether to enable glare
options.scalenumber1.1The scale of the tilt
options['max-glare']number0.6The maximum glare intensity
childrenReact.ReactNode-The children to be displayed
classNamestring-Additional CSS classes