Surface container with header, content and footer slots.
Lifts gently on hover. No glow.
For grouping content.
npx @agents-npm-packages/vibeui add card --dir ./src/components/uiImport
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@/components/ui/card"Generated from the component's TypeScript types, so it always matches the source. * marks a required prop.
also accepts every HTMLAttributes<HTMLDivElement> attribute
| Prop | Type | Default | Description |
|---|---|---|---|
| interactive | boolean | — | Lifts and deepens the shadow on hover. |
also accepts every HTMLAttributes<HTMLDivElement> attribute
No props of its own: it forwards native attributes to the element.
also accepts every HTMLAttributes<HTMLHeadingElement> attribute
No props of its own: it forwards native attributes to the element.
also accepts every HTMLAttributes<HTMLParagraphElement> attribute
No props of its own: it forwards native attributes to the element.
also accepts every HTMLAttributes<HTMLDivElement> attribute
No props of its own: it forwards native attributes to the element.
also accepts every HTMLAttributes<HTMLDivElement> attribute
No props of its own: it forwards native attributes to the element.
import * as React from "react";
import { cn } from "@/lib/utils";
/** Surface container with header, content and footer slots. */
export function Card({
className,
interactive,
...props
}: React.HTMLAttributes<HTMLDivElement> & { interactive?: boolean }) {
return (
<div
className={cn(
"rounded-lg border border-line bg-surface p-6 shadow-quiet",
interactive &&
"transition-[box-shadow,border-color,transform] duration-300 ease-out hover:-translate-y-0.5 hover:border-line-strong hover:shadow-lift",
className,
)}
{...props}
/>
);
}
export function CardHeader({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) {
return <div className={cn("mb-4 flex flex-col gap-1.5", className)} {...props} />;
}
export function CardTitle({
className,
...props
}: React.HTMLAttributes<HTMLHeadingElement>) {
return (
<h3
className={cn("text-[15px] font-medium tracking-[-0.015em] text-ink", className)}
{...props}
/>
);
}
export function CardDescription({
className,
...props
}: React.HTMLAttributes<HTMLParagraphElement>) {
return (
<p className={cn("text-sm leading-relaxed text-muted", className)} {...props} />
);
}
export function CardContent({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) {
return (
<div className={cn("text-sm leading-relaxed text-muted", className)} {...props} />
);
}
export function CardFooter({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) {
return (
<div
className={cn("mt-5 flex items-center gap-2 border-t border-line pt-4", className)}
{...props}
/>
);
}
Exports Card and 5 more. Peer dependencies: clsx, tailwind-merge.