Glass Card
Frosted-glass card surface with backdrop blur and a translucent background. Install Glass Card from the VLLNT UI registry with the shadcn CLI.
Frosted-glass card surface with backdrop blur and a translucent background. Part of the utility family in VLLNT UI, it ships as a machine-readable registry entry — copy the source directly into your app with the shadcn CLI and own it, no runtime dependency on a component library.
Preview
Switch between light and dark to inspect the embedded Storybook preview.
Installation
Add Glass Card to your project with the shadcn CLI. The source lands in your codebase, ready to adapt:
pnpm dlx shadcn@latest add https://ui.vllnt.ai/r/glass-card.jsonSource
import * as React from "react";
import { cn } from "../../lib/utils";
/** Props for {@link GlassCard}. */
export type GlassCardProps = React.ComponentPropsWithoutRef<"div">;
/**
* Frosted-glass surface card with a translucent background and backdrop blur.
*
* @example
* ```tsx
* <GlassCard>Content</GlassCard>
* ```
*/
export const GlassCard = ({
children,
className,
ref,
...props
}: GlassCardProps & { ref?: React.Ref<HTMLDivElement> }) => {
return (
<div
className={cn(
"rounded-xl border border-border/50 bg-card/60 p-6 text-card-foreground shadow-lg backdrop-blur-md",
className,
)}
ref={ref}
{...props}
>
{children}
</div>
);
};
GlassCard.displayName = "GlassCard";
Stories
Explore every variant and state in the interactive Storybook:
Preview
Switch between light and dark to inspect the embedded Storybook preview.