Card
Container for content with header, body, and footer sections.
Installation
Add the Card component using the CLI:
Usage
Displays a card with header, content, and footer. Use Header, ChildContent, and Footer child content to compose the card. When Header or Footer are provided, they render as distinct sections with borders and consistent padding.
Login to your account
Enter your email below to login to your account
Examples
Size
Use the Size parameter set to CardSize.Sm for a more compact card. The small size variant uses smaller spacing.
Small Card
This card uses the small size variant.
The card component supports a size prop that can be set to "sm" for a more compact appearance.
Image
Add an image in the Header slot to create a card with an image. Use HeaderClass="p-0" for a full-bleed image.
Design systems meetup
A practical talk on component APIs, accessibility, and shipping faster.
Variants
Use the Variant parameter to switch between Default (card background) and Outline (transparent with border).
Default
Uses the card background color.
Outline
Transparent background with border.
API Reference
Card
A container card with optional header and footer sections.
Properties
| Name | Type | Description |
|---|---|---|
AdditionalAttributes |
Dictionary<string, Object> |
|
ChildContent |
RenderFragment |
The main content of the card. |
Class |
string |
|
ContentClass |
string |
Additional CSS classes for the content section. |
Footer |
RenderFragment |
Optional footer content rendered below the main content. |
FooterClass |
string |
Additional CSS classes for the footer section. |
Header |
RenderFragment |
Optional header content rendered above the main content. |
HeaderClass |
string |
Additional CSS classes for the header section. |
Size |
CardSize |
The size/spacing of the card sections. |
Variant |
CardVariant |
The visual style variant of the card. |
Methods
| Method | Returns | Description |
|---|---|---|
Equals |
bool |
|
GetHashCode |
int |
|
GetType |
Type |
|
SetParametersAsync |
Task |
|
ToString |
string |