GitHub

Flip Card

Card with front and back that flips on interaction

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { FlipCard } from "@corew500/ui/flip-card"

<FlipCard>Content</FlipCard>

Variants

flipCardVariants

AxisValuesDefault
size
smdefaultlgfull
default

API Reference

Props

PropTypeDefaultDescription
triggerenumhoverHow to trigger the flip
directionenumhorizontalDirection of the flip
flippedenumControlled flipped state
onFlippedChange(flipped: boolean) => voidCallback when flipped state changes
defaultFlippedenumfalseDefault flipped state (uncontrolled)
sizeenum

Accessibility

Keyboard Navigation

  • For click triggers, the entire card becomes keyboard accessible
  • Hidden side content is not in tab order or announced to screen readers

Screen Readers

  • Consider adding aria-label describing the flip action

Additional

  • - Ensure both sides have appropriate semantic markup

Localization

Translatable Content

  • - Pass translated content to FlipCardFront and FlipCardBack children
  • If using text prompts like "Click to flip", ensure they're localized