Card
crenspire-glass-ui/cardFreeComponent
Displays a card with optional glassy variant.
Live preview
live · rendered by the registry
Rendered by crenspire/glass-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://glass-ui.crenspire.com/r/card.jsonSource
1"use client"23import * as React from "react"4import { Card as BaseCard, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"5import { cn } from "@/lib/utils"6import type { GlassCustomization } from "@/lib/glass-utils"7import { hoverEffects, type HoverEffect } from "@/lib/hover-effects"89export interface CardProps extends React.ComponentProps<typeof BaseCard> {10 gradient?: boolean11 animated?: boolean12 hover?: HoverEffect13 glass?: GlassCustomization14}1516/**17 * Glass UI Card - A beautifully designed card component with glassy effects18 * Built on top of the base Card component with enhanced visual styling19 *20 * @example21 * ```tsx22 * // Standard glass variant (default)23 * <Card variant="glass">24 * Content25 * </Card>26 *27 * // Frosted glass variant - enhanced blur and opacity28 * <Card variant="frosted">29 * Content30 * </Card>31 *32 * // Fluted glass variant - vertical ridges texture33 * <Card variant="fluted">34 * Content35 * </Card>36 *37 * // Crystal glass variant - clear with highlights and glow38 * <Card variant="crystal">39 * Content40 * </Card>41 *42 * // Custom glass properties43 * <Card44 * variant="glass"45 * glass={{46 * color: "rgba(139, 92, 246, 0.2)",47 * blur: 30,48 * transparency: 0.3,49 * outline: "rgba(139, 92, 246, 0.5)",50 * innerGlow: "rgba(255, 255, 255, 0.3)",51 * innerGlowBlur: 2552 * }}53 * gradient54 * animated55 * >56 * Content57 * </Card>58 * ```59 */60export const Card = React.forwardRef<HTMLDivElement, CardProps>(61 ({ className, variant = "glass", gradient = false, animated = false, hover = "none", glass, children, ...props }, ref) => {62 return (63 <BaseCard64 ref={ref}65 variant={variant}66 glass={glass}67 className={cn(68 "relative overflow-hidden",69 gradient && "bg-gradient-to-br from-purple-500/10 via-blue-500/10 to-pink-500/10",70 animated && "transition-all duration-300 hover:scale-[1.02] hover:shadow-[var(--glass-shadow-lg)]",71 hoverEffects({ hover }),72 className73 )}74 {...props}75 >76 {children}77 </BaseCard>78 )79 }80)81Card.displayName = "Card"8283export {84 CardContent,85 CardDescription,86 CardFooter,87 CardHeader,88 CardTitle,89}90
What it pulls in
Other registry items
Files it writes
More from crenspire/glass-ui
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | crenspire/glass-ui | Components | Free | 2 deps · 5 files | |
| Alertalert | crenspire/glass-ui | Components | Free | no deps · 5 files | |
| Alert Dialogalert-dialog | crenspire/glass-ui | Components | Free | 1 dep · 5 files | |
| Avataravatar | crenspire/glass-ui | Components | Free | 1 dep · 5 files | |
| Badgebadge | crenspire/glass-ui | Components | Free | no deps · 5 files | |
| Breadcrumbbreadcrumb | crenspire/glass-ui | Components | Free | 2 deps · 5 files | |
| Buttonbutton | crenspire/glass-ui | Components | Free | 1 dep · 5 files | |
| Button Groupbutton-group | crenspire/glass-ui | Components | Free | no deps · 5 files |
