Holographic Card
shadcn-extras/holographic-cardFreeComponent
A 3D floating card with holographic gradients and glitch text.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/NayanDevLab/shadcn-extras/dev/public/c/holographic-card.jsonSource
1import * as React from 'react';2import { cn } from '@/lib/utils';3import './holographic-card.css';45export interface GlitchTextProps extends React.HTMLAttributes<HTMLHeadingElement> {6 text: string;7 as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';8 theme?: {9 c1?: string;10 c2?: string;11 };12}1314export const GlitchText = React.forwardRef<HTMLHeadingElement, GlitchTextProps>(15 ({ className, text, as: Comp = 'h1', theme, style, ...props }, ref) => {16 const customStyle = {17 ...(theme?.c1 ? { '--holo-c1': theme.c1 } : {}),18 ...(theme?.c2 ? { '--holo-c2': theme.c2 } : {}),19 ...style,20 } as React.CSSProperties;2122 return (23 <Comp24 ref={ref}25 className={cn('holographic-glitch', className)}26 data-text={text}27 style={customStyle}28 {...props}29 >30 {text}31 </Comp>32 );33 }34);35GlitchText.displayName = 'GlitchText';3637export interface HolographicCardProps extends Omit<38 React.HTMLAttributes<HTMLDivElement>,39 'title'40> {41 title?: React.ReactNode;42 description?: React.ReactNode;43 buttonText?: string;44 buttonHref?: string;45 theme?: {46 c1?: string;47 c2?: string;48 c3?: string;49 };50}5152export const HolographicCard = React.forwardRef<53 HTMLDivElement,54 HolographicCardProps55>(56 (57 {58 className,59 title,60 description,61 buttonText,62 buttonHref,63 children,64 theme,65 style,66 ...props67 },68 ref69 ) => {70 const customStyle = {71 ...(theme?.c1 ? { '--holo-c1': theme.c1 } : {}),72 ...(theme?.c2 ? { '--holo-c2': theme.c2 } : {}),73 ...(theme?.c3 ? { '--holo-c3': theme.c3 } : {}),74 ...style,75 } as React.CSSProperties;7677 return (78 <div className='holographic-card-wrapper flex h-full w-full items-center justify-center p-8'>79 <div80 ref={ref}81 className={cn(82 'holographic-card w-full max-w-[420px] p-10 text-white',83 className84 )}85 style={customStyle}86 {...props}87 >88 {title && <h2 className='mb-4 text-2xl font-bold'>{title}</h2>}8990 {description && (91 <p className='leading-relaxed opacity-85'>{description}</p>92 )}9394 {children}9596 {buttonText && (97 <a98 href={buttonHref || '#'}99 className='holographic-btn mt-8 px-7 py-3 text-sm'100 >101 {buttonText}102 </a>103 )}104 </div>105 </div>106// … truncated
Files it writes
More from shadcn-extras
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Image Gridanimated-image-grid | shadcn-extras | Components | Free | no deps · 3 files | |
| Blog Card Fourblog-card-four | shadcn-extras | Components | Free | 1 dep | |
| Blog Card Oneblog-card-one | shadcn-extras | Components | Free | no deps | |
| Blog Card Threeblog-card-three | shadcn-extras | Components | Free | 1 dep | |
| Blog Card Twoblog-card-two | shadcn-extras | Components | Free | 1 dep | |
| Bulb Iconbulb-icon | shadcn-extras | Components | Free | 2 deps | |
| Chevron Stepschevron-steps | shadcn-extras | Components | Free | no deps | |
| Circular Gallerycircular-gallery | shadcn-extras | Components | Free | no deps · 3 files |
