Cards Fancy Stable

FlipCard

.md

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

Preview

Installation

pnpm add fancy-ui-svelte
import { FlipCard } from 'fancy-ui-svelte'

Usage

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

<FlipCard />

Examples

Basic Usage

X-Axis Rotation

Flip vertically.

Click to Flip

A toggle: click, tap, Enter or Space. The link on the back stays clickable, and bind:flipped drives it from outside.

Multiple Cards

Props

PropTypeDefaultDescription
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)
flipped booleanfalseWhether the back is showing. Bindable
onflip (flipped: boolean) => void-Called with the new state after every flip
duration number700Length of one flip in milliseconds
glare booleantrueLight 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

SlotDescription
childrenFront face content
backBack face content