BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/scrollxui/card-flip

Card Flip

scrollxui/card-flip
FreeComponent

Renders a card component with flip animation, supporting front/back content.

Live preview

live · rendered by the registry
Rendered by scrollxui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://scrollxui.dev/registry/card-flip.json

Source

components/ui/card-flip.tsxscrollxui.dev/registry/card-flip.json
1'use client';
2import React, { useState } from 'react';
3import { motion } from 'motion/react';
4import { Info, X } from 'lucide-react';
5import { cn } from '@/lib/utils';
6
7function CardFlip({
8 className,
9 children,
10 ...props
11}: React.ComponentProps<'div'> & {
12 children: [React.ReactNode, React.ReactNode];
13}) {
14 const [isFlipped, setIsFlipped] = useState(false);
15 const [front, back] = React.Children.toArray(children);
16
17 return (
18 <div
19 className={cn('relative w-full', className)}
20 style={{ perspective: '1000px' }}
21 {...props}
22 >
23 <motion.div
24 className='relative w-full'
25 initial={false}
26 animate={{ rotateY: isFlipped ? -180 : 0 }}
27 transition={{ duration: 0.6, ease: [0.4, 0, 0.2, 1] }}
28 style={{ transformStyle: 'preserve-3d' }}
29 >
30 <div
31 className='w-full'
32 style={{
33 backfaceVisibility: 'hidden',
34 WebkitBackfaceVisibility: 'hidden',
35 transformStyle: 'preserve-3d',
36 }}
37 >
38 <div className='relative w-full'>
39 <button
40 onClick={() => setIsFlipped(true)}
41 className='absolute top-4 right-4 p-2 rounded-full hover:bg-muted transition-colors z-10'
42 aria-label='Show info'
43 style={{
44 opacity: isFlipped ? 0 : 1,
45 pointerEvents: isFlipped ? 'none' : 'auto',
46 transition: 'opacity 0.3s',
47 }}
48 >
49 <Info className='w-5 h-5 text-muted-foreground' />
50 </button>
51 {front}
52 </div>
53 </div>
54
55 <div
56 className='absolute inset-0 w-full'
57 style={{
58 backfaceVisibility: 'hidden',
59 WebkitBackfaceVisibility: 'hidden',
60 transform: 'rotateY(-180deg)',
61 transformStyle: 'preserve-3d',
62 }}
63 >
64 <div className='relative w-full h-full'>
65 <button
66 onClick={() => setIsFlipped(false)}
67 className='absolute top-4 right-4 p-2 rounded-full hover:bg-muted transition-colors z-10'
68 aria-label='Close'
69 style={{
70 opacity: isFlipped ? 1 : 0,
71 pointerEvents: isFlipped ? 'auto' : 'none',
72 transition: 'opacity 0.3s',
73 }}
74 >
75 <X className='w-5 h-5 text-muted-foreground' />
76 </button>
77 {back}
78 </div>
79 </div>
80// … truncated

What it pulls in

npm packages

  • motion
  • lucide-react
  • clsx
  • tailwind-merge

Other registry items

  • Adityakishore0/ScrollX-UI/utils

Files it writes

  • src/components/ui/card-flip.tsx

Facts

Registry
scrollxui
Type
registry:ui
Access
Free
Files written
1
Licence
NOASSERTION
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on scrollxui scrollxui.dev Adityakishore0/ScrollX-UI on GitHub Raw registry item This item as JSON

More from scrollxui

All 180 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionscrollxuiComponentsFree4 deps
Alert Dialogalert-dialogscrollxuiComponentsFree7 deps
Animated Buttonanimated-buttonscrollxuiComponentsFree4 deps
Animated Tabsanimated-tabsscrollxuiComponentsFree1 dep
Animated Testimonialsanimated-testimonialsscrollxuiComponentsFree2 deps
Animated TextGenerateanimated-textgeneratescrollxuiComponentsFree3 deps
AnnouncementannouncementscrollxuiComponentsFree5 deps
Aspect Ratioaspect-ratioscrollxuiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex