Card
Use Card to group a self-contained summary, settings section, or piece of content with its actions.
Preview
Market summary and inset detail
Compare a raised market card with a live badge and details button against an inset card containing a portfolio progress indicator.
Market overview
See today's watchlist movement at a glance.
Inset surface
Use recessed depth for supporting information.
Installation
New to this Registry? Complete the base setup before continuing.
npx shadcn@latest add @neumorphism-ui/cardInstall the shared base once, then add components and their dependencies with the CLI.
Market summary and inset detail
npx shadcn@latest add @neumorphism-ui/badge @neumorphism-ui/button @neumorphism-ui/card @neumorphism-ui/progressUsage
Build the heading with CardHeader, CardTitle, and CardDescription. Place the main information in CardContent and supporting actions or metadata in CardAction or CardFooter.
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
export default function Example() {
return (
<Card>
<CardHeader><CardTitle>Team workspace</CardTitle></CardHeader>
<CardContent>Invite your team and start a project.</CardContent>
</Card>
);
}API Reference
A layout component composed from Header, Title, Description, Action, Content, and Footer. The root is a div by default, so choose headings and interactive elements that match the content semantics.
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Card | variant | "raised" | "accent" | "soft" | "inset" | "flat" | "raised" | Selects the surface depth and border treatment. |
Card | childrenrequired | React.ReactNode | — | Arranges the composable Card subcomponents. |
CardAction | children | React.ReactNode | — | An action or status area on the right side of the Header. |
CardTitle | childrenrequired | React.ReactNode | — | The Card heading, rendered as h3 by default. |
Accessibility
- 01
Card is a div and does not automatically add a landmark or article role.
- 02
If h3 does not fit the page heading hierarchy, use an appropriate heading element instead of CardTitle.
- 03
When making the entire Card clickable, avoid nesting other buttons or links inside it.