Card
A surface grouping a header, a body and a footer.
Examples
Card
Outline card
Header, body and footer are each optional.
Soft card
Header, body and footer are each optional.
Subtle card
Header, body and footer are each optional.
Razor
<div class="grid w-full gap-4 md:grid-cols-3">
@foreach (var variant in Enum.GetValues<CardVariant>())
{
<KlyCard Variant="variant">
<Header><h3 class="font-semibold">@variant card</h3></Header>
<ChildContent><p class="text-sm text-(--klyroo-text-muted)">Header, body and footer are each optional.</p></ChildContent>
<Footer><KlyButton Label="Action" Size="KlySize.Sm" Variant="ButtonVariant.Outline" /></Footer>
</KlyCard>
}
</div>API
KlyCard
Container with optional header and footer areas, in outline, soft or subtle variants.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Ui |
CardUi |
Per-instance class overrides of the slots of the card, see CardUi . They are merged after the theme and the Class parameter wins on the root slot. | |
Variant |
CardVariant |
CardVariant. |
Look of the card: Outline , Soft or Subtle . Values: Outline, Soft, Subtle. |
Slots
| Name | Type | Description |
|---|---|---|
Footer |
RenderFragment |
Content of the footer of the card. |
Header |
RenderFragment |
Content of the header of the card. |
ChildContent |
RenderFragment |
The body. |
Ui slots
Ui takes a CardUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyCard , after the theme and the app configuration. |
Header |
Classes merged into the header slot of KlyCard , after the theme and the app configuration. |
Body |
Classes merged into the body slot of KlyCard , after the theme and the app configuration. |
Footer |
Classes merged into the footer slot of KlyCard , after the theme and the app configuration. |