BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/scrollxui/flashy-card

Flashy Card

scrollxui/flashy-card
FreeComponent

Interactive card with smooth animated activation and visual effects.

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/flashy-card.json

Source

components/ui/flashy-card.tsxscrollxui.dev/registry/flashy-card.json · first 6 KB
1'use client';
2import React, { useState, useRef, useEffect } from 'react';
3import { cn } from '@/lib/utils';
4
5interface FlashyCardProps extends React.HTMLAttributes<HTMLDivElement> {
6 children?: React.ReactNode;
7 onStateChange?: (isActive: boolean) => void;
8 disabled?: boolean;
9 iconClassName?: string;
10 rippleClassName?: string;
11 glareClassName?: string;
12 defaultSrc?: string;
13 activeSrc?: string;
14 activeType?: 'image' | 'video';
15}
16
17interface FlashyCardContentProps {
18 children: React.ReactNode;
19}
20
21const FlashyCardDefault: React.FC<FlashyCardContentProps> = ({ children }) => {
22 return <>{children}</>;
23};
24
25const FlashyCardActive: React.FC<FlashyCardContentProps> = ({ children }) => {
26 return <>{children}</>;
27};
28
29const FlashyCard = React.forwardRef<HTMLDivElement, FlashyCardProps>(
30 (
31 {
32 children,
33 className,
34 onStateChange,
35 disabled = false,
36 iconClassName,
37 rippleClassName,
38 glareClassName,
39 defaultSrc,
40 activeSrc,
41 activeType,
42 ...props
43 },
44 ref,
45 ) => {
46 const [isSelected, setIsSelected] = useState(false);
47 const [isButtonHovered, setIsButtonHovered] = useState(false);
48 const [isAnimating, setIsAnimating] = useState(false);
49 const [videoReady, setVideoReady] = useState(false);
50 const glareRef = useRef<HTMLDivElement>(null);
51 const cardRef = useRef<HTMLDivElement>(null);
52 const videoRef = useRef<HTMLVideoElement>(null);
53
54 React.useImperativeHandle(ref, () => cardRef.current as HTMLDivElement);
55
56 const childArray = React.Children.toArray(children);
57 const defaultContentChild = childArray.find(
58 (child) =>
59 React.isValidElement(child) && child.type === FlashyCardDefault,
60 );
61 const activeContentChild = childArray.find(
62 (child) => React.isValidElement(child) && child.type === FlashyCardActive,
63 );
64
65 const defaultContent =
66 defaultContentChild ||
67 (defaultSrc && (
68 <div className='aspect-4/3 relative'>
69 <img
70 src={defaultSrc}
71 alt='Default content'
72 className='w-full h-full object-cover'
73 />
74 </div>
75 ));
76
77 const isVideo = (src: string) => {
78 const videoExtensions = ['.mp4', '.webm', '.ogg', '.mov'];
79 return videoExtensions.some((ext) => src.toLowerCase().endsWith(ext));
80 };
81
82 const shouldShowVideo =
83 activeType === 'video' ||
84 (!activeType && activeSrc && isVideo(activeSrc));
85
86 useEffect(() => {
87// … truncated

What it pulls in

npm packages

  • clsx
  • tailwind-merge

Other registry items

  • Adityakishore0/ScrollX-UI/utils

Files it writes

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

Facts

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

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