Skip to content
Premium & Brand

Flip Card

A 3D card that flips between a front and a back face.

Import

tsx
import { FlipCard, FlipCardFront, FlipCardBack } from "@cooud-ui/ui";
bash
npx cooud-ui add flip-card

Examples

API Reference

Generated from the component's exported types.

FlipCardProps

Extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">

PropTypeDefaultDescription
trigger
FlipCardTrigger"hover"What flips the card. `"hover"` flips on pointer hover **and** keyboard focus (so it is fully operable without a mouse); `"click"` toggles on click, Enter or Space and exposes `role="button"` + `aria-pressed`; `"controlled"` never self-flips — you drive it entirely through the prop.
axis
FlipCardAxis"horizontal"Axis the card rotates around. `"horizontal"` spins left↔right (`rotateY`); `"vertical"` tumbles top↔bottom (`rotateX`).
flipped
booleanControlled flip state. When provided the card shows the back face iff `true` and its own hover/click toggling is suppressed (parent owns the state).
defaultFlipped
booleanfalseInitial flip state when uncontrolled.
onFlippedChange
(flipped: boolean) => voidFires with the next flip state whenever the card would flip. Still called while controlled, so you can lift the state up.
aria-label
stringAccessible name for the flip control. Strongly recommended for `trigger="click"`, where the whole card is a single button.