Cards

CardControl · CardGroupControl · CarouselControl

Show products, places or people as cards, in a grid or a carousel.

Overview

CardControl is a Blazor card: a bordered box with an optional header, image, body and footer for one item. Use cards for items users browse and compare: CardGroupControl wraps several in one fx-card-group element that you lay out with your own CSS, as the card group example does with a wrapping grid of equal heights, and CarouselControl shows one card at a time, with arrows and dots to move between them.

Examples

#Card with image, header and footer

Send the quote from the card's footer and its badge and subtitle follow; pick an elevation to compare the shadows; None (Elevation 0) leaves only the border.

Elevation
Quote LIS-0001 Lisbon city break
Quoted · 3 lines · $1,720
Route sketch: airport, old-town hotel and food tour

Return flights, four nights in an old-town hotel and a guided food tour.

#Card group

Pick a status to filter the quotes. CardGroupControl renders a plain <div>, so the example lays the cards out itself with one rule, .quotes ::deep .fx-card-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }, which keeps the remaining cards in equal heights and drops to two columns, then one, as the window narrows.

Status
6 of 6 quotes
AMF-0002 Puddleby

Amalfi coast drive, 9 lines, $6,240.

CPT-0003 Wobblesworth

Cape winelands, 8 lines, $8,150.

KYO-0001 Thistlewood

Kyoto long weekend, 6 lines, $4,860.

LIS-0001 Door

Lisbon city break, 3 lines, $1,720.

LIS-0002 Marmalade

Lisbon Explorer, 5 lines, $3,480.

HOI-0004 Bumblethorpe

Hoi An lantern trail, 7 lines, $5,310.

Documentation

ParameterTypeDefaultDescription
Title (base)string?nullHeader heading. The base class documents it as a descriptive title; this control renders it as an <h5>.
Subtitlestring?nullSecond line under the title.
ImageUrlstring?nullImage rendered full width between header and body.
ImageAltstring?nullAlt text; falls back to Title, then "Card image".
Elevationint1Shadow depth 1 to 3; 0 or less draws only the border, and above 3 has no shadow rule.
HeaderContentRenderFragment?nullReplaces the title and subtitle inside the header.
ChildContentRenderFragment?nullBody.
FooterContentRenderFragment?nullFooter, a right-aligned flex row with a 0.5rem gap.
CssClass / Style (base)string?nullOn the fx-card root. The base Visible is not applied.
Enabled / Id / Tag / Data / Parent (base)nullAccepted but have no effect. A written id binds to Id, so it does not reach the root.
(unmatched attributes)Dictionary<string,object>—Forwarded to the root <div>.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.