Card
A Shadcn-styled card container with header, content, and footer sections.
A passive, four-part container for grouping related content into Root, Header, Content, and Footer sections. The examples on this page use the Shadcn Rhea style preset.
Preview
Section titled “Preview”<wc-shadcn-card-root style-profile="rhea" class="w-full max-w-sm">
<wc-shadcn-card-header style-profile="rhea">
<h3 class="text-base font-medium">Deployment summary</h3>
<p class="text-sm text-muted-foreground">
Production release v2.4 is live across all regions.
</p>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<p class="text-sm">
All 12 edge workers passed health checks with 99.98% uptime
over the last 24 hours.
</p>
</wc-shadcn-card-content>
<wc-shadcn-card-footer style-profile="rhea">
<a
href="#card-contract"
class="text-sm font-medium underline underline-offset-4 hover:opacity-80"
>
View usage guide
</a>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>Installation
Section titled “Installation”This component is available from workspace source. In your application, install the CLI, Shadcn prototypes and target adapter built from the same workspace revision, then initialize the project with that CLI. Run the locally installed CLI to generate the facade.
pnpm exec proto-ui add wc shadcn-card
npm exec -- proto-ui add wc shadcn-card
yarn exec proto-ui add wc shadcn-card
bun run proto-ui add wc shadcn-card
Replace wc with react, vue, or vue2 to generate the local facade for your framework. You can also import ShadcnCardRoot, ShadcnCardHeader, ShadcnCardContent, and ShadcnCardFooter (or their lowercase aliases) directly from @proto.ui/prototypes-shadcn/card.
Usage
import { ShadcnCardRoot, ShadcnCardHeader, ShadcnCardContent, ShadcnCardFooter,} from '@proto.ui/prototypes-shadcn/card';<ShadcnCardRoot styleProfile="rhea"> <ShadcnCardHeader> <h3 className="text-base font-medium">Card Title</h3> <p className="text-sm text-muted-foreground">Card Description</p> </ShadcnCardHeader> <ShadcnCardContent> <p className="text-sm">Card Content</p> </ShadcnCardContent> <ShadcnCardFooter> <p className="text-sm">Card Footer</p> </ShadcnCardFooter></ShadcnCardRoot>Composition:
ShadcnCardRoot├── ShadcnCardHeader├── ShadcnCardContent└── ShadcnCardFooter- Structure and typography:
Header,Content, andFootermanage horizontal insets and section rhythm. Render native headings and paragraphs inside them, or compose Text withsize="base",weight="medium",tone="inherit"for titles andsize="sm",tone="muted"for secondary descriptions. - Style presets: Without an explicit selection,
Rootinherits the nearest Style Scope and falls back tonew-york-v4(rounded-xl, border, 24px spacing, 8px Header gap). Under Shadcn Rhea, it uses a hairline foreground ring, theme-capped 24px radius, 20px default spacing, and compact 16pxsmdensity. Under Shadcn Luma, it usesrounded-4xlcorners,shadow-md, a subtlering-foreground/5(ring-foreground/10in dark mode) hairline ring, and 24px default spacing (16pxforsm). - Passive semantics: All four parts are purely presentational with no extra ARIA roles, focus stops, or events; links, inputs, and buttons inside the card keep their own behavior.
Examples
Section titled “Examples”Login Form
Section titled “Login Form”Compose Header actions, paired Label / Input fields, and full-width Footer buttons into a complete sign-in card.
<wc-shadcn-card-root style-profile="rhea" class="w-full max-w-sm">
<wc-shadcn-card-header style-profile="rhea">
<div class="flex items-start justify-between gap-2">
<div class="grid gap-1">
<h3 class="text-base font-medium">Login to your account</h3>
<p class="text-sm text-muted-foreground">
Enter your email below to login to your account
</p>
</div>
<wc-shadcn-button
style-profile="rhea"
variant="link"
size="sm"
>
Sign Up
</wc-shadcn-button>
</div>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<div class="flex flex-col gap-5">
<div class="grid gap-2">
<label for="card-login-email" class="text-sm font-medium">
Email
</label>
<wc-shadcn-input-root
style-profile="rhea"
id="card-login-email"
placeholder="m@example.com"
></wc-shadcn-input-root>
</div>
<div class="grid gap-2">
<div class="flex items-center">
<label
for="card-login-password"
class="text-sm font-medium"
>
Password
</label>
<a
href="#card-contract"
class="ms-auto text-sm underline-offset-4 hover:underline"
>
Forgot your password?
</a>
</div>
<wc-shadcn-input-root
style-profile="rhea"
id="card-login-password"
placeholder="Enter your password"
></wc-shadcn-input-root>
</div>
</div>
</wc-shadcn-card-content>
<wc-shadcn-card-footer
style-profile="rhea"
class="flex-col gap-2"
>
<wc-shadcn-button style-profile="rhea" class="w-full">
Login
</wc-shadcn-button>
<wc-shadcn-button
style-profile="rhea"
variant="outline"
class="w-full"
>
Login with Google
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>Set size="sm" on Root under Shadcn Rhea or Shadcn Luma to switch every card section to compact 16px spacing and insets (down from 20px in Rhea and 24px in Luma).
<wc-shadcn-card-root
style-profile="rhea"
size="sm"
class="w-full max-w-xs"
>
<wc-shadcn-card-header style-profile="rhea">
<h3 class="text-base font-medium">Scheduled reports</h3>
<p class="text-sm text-muted-foreground">
Weekly snapshots. No more manual exports.
</p>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<ul class="grid gap-2 py-1 text-sm">
<li>Choose a schedule (daily, or weekly).</li>
<li>Send to channels or specific teammates.</li>
<li>Include charts, tables, and key metrics.</li>
</ul>
</wc-shadcn-card-content>
<wc-shadcn-card-footer
style-profile="rhea"
class="flex-col gap-2"
>
<wc-shadcn-button style-profile="rhea" size="sm" class="w-full">
Set up scheduled reports
</wc-shadcn-button>
<wc-shadcn-button
style-profile="rhea"
variant="outline"
size="sm"
class="w-full"
>
See what's new
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>Dividers
Section titled “Dividers”Set divider={true} on Header and Footer to render section dividers with matching inner padding for scrollable agreements or structured panels.
<wc-shadcn-card-root style-profile="rhea" class="w-full max-w-sm">
<wc-shadcn-card-header style-profile="rhea" divider>
<h3 class="text-base font-medium">Terms of Service</h3>
<p class="text-sm text-muted-foreground">
Review the terms before accepting the agreement.
</p>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<div
class="max-h-40 space-y-3 overflow-y-auto text-sm leading-relaxed text-muted-foreground"
>
<p>
These terms govern your use of the workspace, including
access to shared documents and collaboration tools.
</p>
<p>
By continuing, you agree to keep your account credentials
secure.
</p>
</div>
</wc-shadcn-card-content>
<wc-shadcn-card-footer
style-profile="rhea"
divider
class="justify-end gap-2"
>
<wc-shadcn-button
style-profile="rhea"
variant="outline"
size="sm"
>
Decline
</wc-shadcn-button>
<wc-shadcn-button style-profile="rhea" size="sm">
Accept
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>Place a cover image before Header and add pt-0 on Root so the top edge clips cleanly to the Shadcn Rhea rounded frame.
<wc-shadcn-card-root
style-profile="rhea"
class="w-full max-w-sm pt-0"
>
<img
src="/images/base-image/landscape.svg"
alt="Design systems meetup cover"
class="aspect-video w-full object-cover"
/>
<wc-shadcn-card-header style-profile="rhea">
<div class="flex items-center justify-between gap-2">
<h3 class="text-base font-medium">Design systems meetup</h3>
<span
class="rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground"
>
Featured
</span>
</div>
<p class="text-sm text-muted-foreground">
A practical talk on component APIs, accessibility, and
shipping faster.
</p>
</wc-shadcn-card-header>
<wc-shadcn-card-footer style-profile="rhea">
<wc-shadcn-button style-profile="rhea" class="w-full">
View Event
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>Density Comparison
Section titled “Density Comparison”Compare size="default" (20px) and size="sm" (16px) side by side with section dividers enabled.
<div class="grid w-full max-w-2xl items-start gap-5 md:grid-cols-2">
<wc-shadcn-card-root style-profile="rhea" size="default">
<wc-shadcn-card-header style-profile="rhea" divider>
<h3 class="text-base font-medium">Default density</h3>
<p class="text-sm text-muted-foreground">
size="default" · 20px section inset & gap
</p>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<p class="text-sm">
Balanced rhythm for primary feature cards, forms, and
editorial summaries.
</p>
</wc-shadcn-card-content>
<wc-shadcn-card-footer style-profile="rhea" divider>
<wc-shadcn-button
style-profile="rhea"
variant="outline"
size="sm"
>
Open details
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>
<wc-shadcn-card-root style-profile="rhea" size="sm">
<wc-shadcn-card-header style-profile="rhea" divider>
<h3 class="text-base font-medium">Compact density</h3>
<p class="text-sm text-muted-foreground">
size="sm" · 16px section inset & gap
</p>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<p class="text-sm">
Tighter spacing for sidebar widgets, checklists, and
high-density dashboards.
</p>
</wc-shadcn-card-content>
<wc-shadcn-card-footer style-profile="rhea" divider>
<wc-shadcn-button
style-profile="rhea"
variant="outline"
size="sm"
>
Open details
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>
</div>Set dir="rtl" on the container and use logical utilities such as ms-auto so card headers, forms, and actions adapt to right-to-left scripts.
<div dir="rtl" class="w-full max-w-sm">
<wc-shadcn-card-root style-profile="rhea" class="w-full">
<wc-shadcn-card-header style-profile="rhea">
<div class="flex items-start justify-between gap-2">
<div class="grid gap-1">
<h3 class="text-base font-medium">
تسجيل الدخول إلى حسابك
</h3>
<p class="text-sm text-muted-foreground">
أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك
</p>
</div>
<wc-shadcn-button
style-profile="rhea"
variant="link"
size="sm"
>
إنشاء حساب
</wc-shadcn-button>
</div>
</wc-shadcn-card-header>
<wc-shadcn-card-content style-profile="rhea">
<div class="grid gap-2">
<label for="rtl-email" class="text-sm font-medium">
البريد الإلكتروني
</label>
<wc-shadcn-input-root
style-profile="rhea"
id="rtl-email"
placeholder="m@example.com"
></wc-shadcn-input-root>
</div>
</wc-shadcn-card-content>
<wc-shadcn-card-footer
style-profile="rhea"
class="flex-col gap-2"
>
<wc-shadcn-button style-profile="rhea" class="w-full">
تسجيل الدخول
</wc-shadcn-button>
<wc-shadcn-button
style-profile="rhea"
variant="outline"
class="w-full"
>
تسجيل الدخول باستخدام Google
</wc-shadcn-button>
</wc-shadcn-card-footer>
</wc-shadcn-card-root>
</div>ShadcnCardRoot
Section titled “ShadcnCardRoot”Root card container that also defines the style and density boundary for nested parts.
| Prop | Type | Default |
|---|---|---|
styleProfile | 'luma' 'rhea' 'new-york-v4' 'new-york' 'inherit' | 'inherit' → nearest scope → 'new-york-v4' |
size | 'default' 'sm' | 'default' |
ShadcnCardHeader
Section titled “ShadcnCardHeader”Header region for titles, descriptions, and header actions.
| Prop | Type | Default |
|---|---|---|
styleProfile | 'luma' 'rhea' 'new-york-v4' 'new-york' 'inherit' | 'inherit' |
divider | boolean | false |
ShadcnCardContent
Section titled “ShadcnCardContent”Main body region providing horizontal padding aligned with header and footer.
| Prop | Type | Default |
|---|---|---|
styleProfile | 'luma' 'rhea' 'new-york-v4' 'new-york' 'inherit' | 'inherit' |
ShadcnCardFooter
Section titled “ShadcnCardFooter”Footer region for actions and secondary metadata.
| Prop | Type | Default |
|---|---|---|
styleProfile | 'luma' 'rhea' 'new-york-v4' 'new-york' 'inherit' | 'inherit' |
divider | boolean | false |
All four parts are passive presentational slots and emit no custom events or exposed methods.