Flip Card
Basic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { FlipCard } from "@corew500/ui/flip-card"
<FlipCard>Content</FlipCard>Variants
flipCardVariants
| Axis | Values | Default |
|---|---|---|
| size | smdefaultlgfull | default |
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| trigger | enum | hover | How to trigger the flip |
| direction | enum | horizontal | Direction of the flip |
| flipped | enum | — | Controlled flipped state |
| onFlippedChange | (flipped: boolean) => void | — | Callback when flipped state changes |
| defaultFlipped | enum | false | Default flipped state (uncontrolled) |
| size | enum | — | — |
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