Card
A versatile card component with header, content, footer, and image support
Brook
New
Defining a brook
A small, natural stream of fresh water flowing along a course towards a river, lake, or sea.
import { Droplets } from "lucide-react";
import { Badge } from "@/components/ui/badge/badge";
import { Button } from "@/components/ui/button/button";
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardIcon,
CardTitle,
} from "@/components/ui/card/card";
import styles from "./card-demo.module.css";
export default function CardDemo() {
return (
<Card className={styles.card}>
<CardHeader>
<div>
<CardIcon>
<Droplets />
</CardIcon>
<CardTitle>Brook</CardTitle>
</div>
<CardAction>
<Badge size="sm" variant="secondary">
New
</Badge>
</CardAction>
<CardDescription>Defining a brook</CardDescription>
</CardHeader>
<CardContent>
<p>A small, natural stream of fresh water flowing along a course towards a river, lake, or sea.</p>
</CardContent>
<CardFooter>
<Button size="sm">Click me</Button>
</CardFooter>
</Card>
);
}
npx shadcn@latest add @roiui/cardnpx shadcn@latest add @roiui/card-tailwindanatomy
<Card>
<CardHeader>
<CardTitle />
<CardAction />
<CardDescription />
</CardHeader>
<CardContent />
<CardFooter />
</Card>
Component props
Prop
Type
Default
Name
variantDescription
Visual style variant of the card - lift adds hover elevation effects
Type
"default" | "lift"Default
"default"Name
classNameDescription
Additional CSS classes to apply to the card
Type
stringDefault
-
Name
childrenDescription
The content to display inside the card
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
classNameDescription
Additional CSS classes to apply to the card header
Type
stringDefault
-
Name
childrenDescription
Content for the card header section
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
classNameDescription
Additional CSS classes to apply to the card title
Type
stringDefault
-
Name
childrenDescription
The title content to display
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
classNameDescription
Additional CSS classes to apply to the card description
Type
stringDefault
-
Name
childrenDescription
The description content to display
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
classNameDescription
Additional CSS classes to apply to the card content
Type
stringDefault
-
Name
childrenDescription
The main content of the card
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
classNameDescription
Additional CSS classes to apply to the card footer
Type
stringDefault
-
Name
childrenDescription
Content for the card footer section
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
srcDescription
The source URL of the image
Type
stringDefault
-
Name
altDescription
Alternative text for the image
Type
stringDefault
-
Name
classNameDescription
Additional CSS classes to apply to the image
Type
stringDefault
-
Name
childrenDescription
Optional content to overlay on the image
Type
ReactNodeDefault
-
Component props
Prop
Type
Default
Name
classNameDescription
Additional CSS classes to apply to the icon container
Type
stringDefault
-
Name
childrenDescription
Icon content (typically an SVG or icon component)
Type
ReactNodeDefault
-
Transactions
Acme Corp.
14:30, July 31, 2025
-$7894
Brook Inc.
11:11, July 31, 2025
$4574
Globex Industries
10:22, July 31, 2025
$27,440
AWS
3:00, July 31, 2025
-$740
Zenith Labs
16:50, July 31, 2025
$14,019
"use client";
import { Button } from "@/components/ui/button/button";
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card/card";
import styles from "./card-transaction.module.css";
const transactions = [
{
id: "ACME001",
from: "Acme Corp.",
date: "14:30, July 31, 2025",
amount: "-$7894",
},
{
id: "BROOK02",
from: "Brook Inc.",
date: "11:11, July 31, 2025",
amount: "$4574",
},
{
id: "GLOBEX3",
from: "Globex Industries",
date: "10:22, July 31, 2025",
amount: "$27,440",
},
{
id: "AWS0004",
from: "AWS",
date: "3:00, July 31, 2025",
amount: "-$740",
},
{
id: "ZENITH5",
from: "Zenith Labs",
date: "16:50, July 31, 2025",
amount: "$14,019",
},
];
export function CardTransaction() {
return (
<Card className={styles.card}>
<CardHeader>
<CardTitle className={styles.title}>Transactions</CardTitle>
<CardAction>
<Button size="sm" variant="ghost">
View All
</Button>
</CardAction>
</CardHeader>
<CardContent>
{transactions.map(({ id, from, date, amount }) => (
<div className={styles.item} key={id}>
<div className={styles.itemInfo}>
<div className={styles.itemFrom}>{from}</div>
<div className={styles.itemDate}>{date}</div>
</div>
<div className={styles.itemAmount}>{amount}</div>
</div>
))}
</CardContent>
</Card>
);
}