Card
Flip Card
Flip animated card for your awesome UI design
Overview
The FlipCard component is an interactive UI card that flips on hover or interaction. It’s ideal for displaying dual-faced content, such as feature highlights, product details, or team info.
Key features include:
- Flip Animation: Choose from
flipY,flipX, orflipBoth. - Custom Content: Pass any JSX elements as front and back.
- Styled Container: Easily apply custom styles via
className.
Front
Back
Hello
Goodbye
🌞 Day
🌜 Night
CLI Installation
Ensure your project is using ShadCN and the custom UI system. Then run:
Manual Installation
To manually set up the FlipCard component in your project, follow these steps:
- Go to your
srcdirectory. - Create a folder structure:
components/ui/flipCard. - Inside the
flipCardfolder, create a file namedflipCard.tsx. - Paste the following code into
flipCard.tsx.
Usage
Import and use the FlipCard component like this:
Props
| Prop | Type | Description | Default |
|---|---|---|---|
front | ReactNode | Content displayed on the front of the flip card | "Front" |
back | ReactNode | Content displayed on the back of the flip card | "Back" |
animation | string | Animation style: flipY, flipX, or flipBoth | "flipY" |
className | string | Additional Tailwind classes for the outer container | "" |