Card

A React card built from header, title, description, content, and footer parts, plus media frames, stat trends, sparklines, and a feature link row.

Loading preview

Examples

Practical examples and common states for the same installable component.

Default

Static content card with premium dark/light mode surface shadow config.

examples/card-default.tsx
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/wensity/card";
export function CardDefault() {
return (
<Card className="w-[380px]">
<CardHeader>
<CardTitle>System Information</CardTitle>
<CardDescription>Overview of current system state.</CardDescription>
</CardHeader>
<CardContent className="space-y-3">
<div className="flex items-center justify-between text-xs border-b border-zinc-100 dark:border-white/[0.04] pb-2">
<span className="text-zinc-500">Node Status</span>
<span className="font-semibold text-emerald-500">Operational</span>
</div>
<div className="flex items-center justify-between text-xs border-b border-zinc-100 dark:border-white/[0.04] pb-2">
<span className="text-zinc-500">Active Load</span>
<span className="font-semibold dark:text-zinc-300">14.8%</span>
</div>
</CardContent>
</Card>
);
}

Interactive

Sleek hover highlights for border and background (with no press scaling).

examples/card-interactive.tsx
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/wensity/card";
export function CardInteractive() {
return (
<Card interactive className="w-[380px]">
<CardHeader>
<CardTitle>Interactive Node</CardTitle>
<CardDescription>Hover over this card to view details.</CardDescription>
</CardHeader>
<CardContent>
<p className="text-xs text-zinc-600 dark:text-zinc-400">
Features transition-aware border tinting and subtle background shifts.
</p>
</CardContent>
</Card>
);
}

Media

Opt-in media zoom that keeps the frame stable and respects motion preferences.

examples/card-media.tsx
import { Card, CardMedia, CardHeader, CardTitle, CardDescription } from "@/components/wensity/card";
export function CardMediaDemo() {
return (
<Card interactive className="w-[380px]">
<CardMedia aspectRatio="video" hoverZoom>
<img
src="https://assets.wensity.com/photos/landscape/moonlit-frozen-lake.webp"
alt="Snow-capped mountains under a full moon"
/>
</CardMedia>
<CardHeader>
<CardTitle>Media Preview</CardTitle>
<CardDescription>Cropped layout media demo.</CardDescription>
</CardHeader>
</Card>
);
}

Stat

Large numbers with trend badges and path-animating SVG sparklines.

examples/card-stat.tsx
import { Card, CardHeader, CardTitle, CardStatTrend, CardStatSparkline } from "@/components/wensity/card";
export function CardStat() {
return (
<Card className="w-[380px]">
<CardHeader className="flex flex-row items-center justify-between pb-2 space-y-0">
<div>
<CardTitle className="text-sm font-semibold text-zinc-500">Network Load</CardTitle>
<div className="mt-1 flex items-baseline gap-2">
<span className="text-3xl font-bold font-mono tracking-tight text-white">842 GB</span>
<CardStatTrend value="8.4%" trend="down" />
</div>
</div>
<CardStatSparkline
data={[30, 28, 25, 27, 24, 22, 19, 18, 16, 15, 14]}
trend="down"
width={90}
height={32}
/>
</CardHeader>
</Card>
);
}

Feature

Includes icons and CTA links with responsive arrow shifts.

examples/card-feature.tsx
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, CardFeatureAction } from "@/components/wensity/card";
import { IconServer } from "@tabler/icons-react";
export function CardFeature() {
return (
<Card interactive className="w-[380px]">
<CardHeader>
<div className="inline-flex size-9 items-center justify-center rounded-xl bg-blue-500/10 text-blue-500 border border-blue-500/20 mb-3">
<IconServer className="size-5" />
</div>
<CardTitle>Server Configuration</CardTitle>
<CardDescription>Deploy microservices in minutes.</CardDescription>
</CardHeader>
<CardContent>
<p className="text-xs text-zinc-600 dark:text-zinc-400 leading-relaxed">
Instantly setup containers with auto-scaling networks and dedicated storage allocations.
</p>
</CardContent>
<CardFooter className="pt-2">
<CardFeatureAction label="Manage Servers" />
</CardFooter>
</Card>
);
}

Overview

Card is a React and Tailwind CSS card component, in Next.js or any React app, assembled from CardHeader, CardTitle, CardDescription, CardContent, and CardFooter, the same parts shadcn users already know. CardMedia frames an image or video at a video, square, or portrait ratio and can zoom it gently on hover. For dashboards, CardStatTrend prints a value with an up, down, or flat arrow in a matching color, and CardStatSparkline draws a small SVG line that traces itself in. CardTitle always renders an h3, so check that it fits the heading order of your page.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add card

Usage

Import Card from @/components/wensity/card and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
CardFooter
} from "@/components/wensity/card";
export function CardDemo() {
return (
<Card>
<CardHeader>
<CardTitle>Card Title</CardTitle>
<CardDescription>Card Description</CardDescription>
</CardHeader>
<CardContent>
<p>Card Content goes here.</p>
</CardContent>
</Card>
);
}

Props

PropTypeDefaultDescription
interactivebooleanfalseAdds hover and focus affordances for cards that act as links or buttons.
  • Expanding Cards component preview

    Expanding Cards

    Hover a tall editorial strip and it opens wide, the rest of the row holding as tight vertical slivers of the same image.

  • Fan Hover Card Stack component preview

    Fan Hover Card Stack

    Hover a stacked profile deck and watch the cards fan outward in sequence while the active one lifts to the front.

  • Glowing Border component preview

    Glowing Border

    Glowing border CSS for cards: a cursor glowing effect, or beams, spins and pulses.

  • KPI Card with Sparkline component preview

    KPI Card with Sparkline

    Dashboard KPI cards with a smooth SVG sparkline chart and a glowing dot that snaps to whichever value you scrub across.