# FlipCard

> Card that flips in 3D to reveal its back, on hover (plus focus and tap) or as a click toggle; it lifts and lands with a slight overshoot, keeps turning the way the pointer travels, and its faces catch a sweeping sheen and shade edge-on.

- Package: `fancy-ui-vue` (Vue 3.5+ + Tailwind CSS v4)
- Category: Cards
- Tags: card, flip, 3d, hover, click, toggle, animation, interactive
- Types: `FlipCardProps`, `FlipCardTrigger`
- Docs: https://fancy-ui.rama.app/docs/components/flip-card
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/vue/src/components/flip-card

## Import

```vue
<script setup lang="ts">
import { FlipCard } from 'fancy-ui-vue';
</script>
```

Setup (once per project): `npm install fancy-ui-vue`, then put these lines in your main CSS file (the stylesheet imports go right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-vue/tailwind.css";
@import "fancy-ui-vue/styles.css";
```

Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in a Vue template; when one differs from the Svelte name, the Svelte name follows in parentheses. Snippets become named slots (`#default` is the default snippet), a prop the Vue port declares as a model is a `v-model:<name>` (except `ref`, exposed via `defineExpose({ ref })`: put a template ref on the component and read `.ref`) and callbacks are listeners (`onclick` is `@click`). Every component sets `inheritAttrs: false`: `class` is a declared prop, merged where the Svelte component applies it (not always the root element), and only when the props table below lists it; other attributes do not fall through unless the package README lists the component as forwarding native attributes. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/vue#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rotate` | `"x" \| "y"` | `"y"` | Axis of rotation for the flip effect |
| `trigger` | `"hover" \| "click"` | `"hover"` | Hover flips on pointer hover, keyboard focus and tap; click makes the card a toggle button (click, tap, Enter, Space) |
| `v-model:flipped` (Svelte `flipped`) | `boolean` | `false` | Whether the back is showing. Bindable |
| `@flip` (Svelte `onflip`) | `(flipped: boolean) => void` | — | Called with the new state after every flip |
| `duration` | `number` | `700` | Length of one flip in milliseconds |
| `glare` | `boolean` | `true` | Light the faces as they turn: a sweeping sheen and an edge-on shade |
| `label` | `string` | — | Accessible name for the card |
| `class` | `string` | — | Additional classes; size the card here (default h-72 w-56) |

## Slots

| Slot | Description |
| --- | --- |
| `#default` (Svelte `children`) | Front face content |
| `#back` (Svelte `back`) | Back face content |

## Example

No Vue example is published for this component yet: start from the import above and the props table. The full examples are Svelte-only, on https://fancy-ui.rama.app/docs/components/flip-card.md.
