āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/adityakishore0/scrollx-ui/components/card-flip ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<Step>Install the following dependencies:</Step> <DepsOptions name="framer-motion" />
<Step>Copy and paste the following code into your project.</Step>
<p> <code>card-flip.tsx</code> </p> <ComponentSource name="card-flip" /><Step>Add util file</Step>
<p> <code>lib/utils.ts</code> </p>import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
</Steps>
</TabsContent>
</Tabs>
import {
CardFlip,
CardFlipFront,
CardFlipBack,
CardFlipHeader,
CardFlipFooter,
CardFlipTitle,
CardFlipDescription,
CardFlipContent,
CardFlipAction,
} from "@/components/ui/card-flip";
<CardFlip>
<CardFlipFront>
<CardFlipHeader>
<CardFlipTitle>Front Title</CardFlipTitle>
</CardFlipHeader>
<CardFlipContent>
<p>Front Content</p>
</CardFlipContent>
</CardFlipFront>
<CardFlipBack>
<CardFlipHeader>
<CardFlipTitle>Back Title</CardFlipTitle>
</CardFlipHeader>
<CardFlipContent>
<p>Back Content</p>
</CardFlipContent>
</CardFlipBack>
</CardFlip>
Info and X buttons were not hiding correctly during card flip transitions.WebkitBackfaceVisibility and refining transformStyle for smoother 3D rendering in Safari.Renders a card component with flip animation, supporting front/back content.
<PropsTable rows={[ { prop: "className", type: "string", default: "ā", description: "Custom CSS classes for the root card container.", }, { prop: "...props", type: "div props", default: "ā", description: "All standard HTML div attributes.", }, { prop: "children", type: "ReactNode[]", default: "ā", description: "Front and back card content as two nodes.", }, { prop: "CardFlipFront", type: "React.ReactNode", default: "ā", description: "Front side of the card, containing main content.", }, { prop: "CardFlipBack", type: "React.ReactNode", default: "ā", description: "Back side of the card, shown on flip.", }, { prop: "CardFlipHeader", type: "React.ReactNode", default: "ā", description: "Header section inside front or back card.", }, { prop: "CardFlipTitle", type: "React.ReactNode", default: "ā", description: "Title inside the header section.", }, { prop: "CardFlipDescription", type: "React.ReactNode", default: "ā", description: "Description inside the header section.", }, { prop: "CardFlipAction", type: "React.ReactNode", default: "ā", description: "Action element (e.g., button) in the header.", }, { prop: "CardFlipContent", type: "React.ReactNode", default: "ā", description: "Main content area inside the card.", }, { prop: "CardFlipFooter", type: "React.ReactNode", default: "ā", description: "Footer section inside the card.", }, ]} />
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā