Skip to main content
A dynamic flip card with smooth 180-degree flipping animations along both the X and Y axes. Perfect for creating engaging, interactive cards that reveal additional content on flip.

Installation

npx inspira-ui add flip-card

Usage

<template>
  <FlipCard rotate="y" class="w-64 h-64">
    <!-- Front side -->
    <template #default>
      <div class="flex items-center justify-center h-full bg-blue-500 text-white">
        <h3>Front Side</h3>
      </div>
    </template>
    
    <!-- Back side -->
    <template #back>
      <div class="flex items-center justify-center h-full bg-purple-500 text-white">
        <h3>Back Side</h3>
      </div>
    </template>
  </FlipCard>
</template>

<script setup>
import { FlipCard } from '@/components/ui/flip-card'
</script>

Props

Prop NameTypeDefaultDescription
classstring-The class to be applied to the component.
rotatex | yyYou can pass the rotate value as you want.

Slots

Slot NameDescription
defaultComponent to show as front.
backComponent to show as back.

Credits

Credits to SivaReddy Uppathi for this component.

Build docs developers (and LLMs) love