BzCard / BzStatCard

Cards

Dashboard stat cards, and a general card with ten different looks.

Stat cards (dashboard)

For showing one key number along with its trend. Filled makes the card solid.

12,480
Active users
12%
3,210
Orders
8%
89.5M
Revenue (Toman)
3%
42
Pending
Parameter Description
Value / LabelThe headline number and its label
Trend / TrendUpThe change percentage and its direction
FilledA solid background instead of a soft one
ColorColour of the icon and accents
razor
@using BzCore.Components.Card
@using BzCore.Enums

<div class="card-grid">
    <BzStatCard Icon="fa-solid fa-users" Value="12,480" Label="کاربران فعال"
                Trend="12%" TrendUp="true" Color="BzColor.Primary" />

    <BzStatCard Icon="fa-solid fa-cart-shopping" Value="3,210" Label="سفارش ها"
                Trend="8%" TrendUp="true" Color="BzColor.Success" Filled />

    <BzStatCard Icon="fa-solid fa-coins" Value="89.5M" Label="درآمد (تومان)"
                Trend="3%" TrendUp="false" Color="BzColor.Warning" />

    <BzStatCard Icon="fa-solid fa-clock-rotate-left" Value="42" Label="در انتظار"
                Color="BzColor.Info" />
</div>

<style>
    /* equal-height, responsive columns */
    .card-grid {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        align-items: stretch;
    }
    .card-grid > * { height: 100%; }
</style>
The ten card variants

All variants share one snippet; only Variant changes. Media and Horizontal need an ImageUrl.

Elevated
Sample card

This is a Elevated card.

Outlined
Sample card

This is a Outlined card.

Filled
Sample card

This is a Filled card.

Soft
Sample card

This is a Soft card.

Gradient
Sample card

This is a Gradient card.

Glass
Sample card

This is a Glass card.

AccentTop
Sample card

This is a AccentTop card.

AccentStart
Sample card

This is a AccentStart card.

Media
Media
Sample card

This is a Media card.

Horizontal
Horizontal
Sample card

This is a Horizontal card.

razor
@using BzCore.Components.Card
@using BzCore.Components.Button
@using BzCore.Enums

<div class="card-grid">
    @foreach (var v in Enum.GetValues<BzCardVariant>())
    {
        <BzCard Variant="v" Color="BzColor.Primary" Title="@v.ToString()"
                Subtitle="نمونه کارت" Icon="fa-solid fa-cube" Hoverable
                ImageUrl="@(v is BzCardVariant.Media or BzCardVariant.Horizontal ? "/img/ph.svg" : null)">
            <ChildContent>
                <p>این یک کارت از نوع <strong>@v</strong> است.</p>
            </ChildContent>
            <Footer>
                <BzButton Size="BzSize.Small" Text="جزییات" Variant="BzButtonVariant.Soft" />
                <BzButton Size="BzSize.Small" Text="حذف" Variant="BzButtonVariant.Text"
                          Color="BzColor.Danger" />
            </Footer>
        </BzCard>
    }
</div>

<style>
    .card-grid {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        align-items: stretch;
    }
    .card-grid > * { height: 100%; }
</style>
Dynamic size and colour

Set a fixed Width, and change the accent with Color.

Gold plan

Full access to every feature.

Success

A card tinted with the success colour.

Important

A card with a side accent bar.

Section Description
ChildContentThe card body
Header / FooterTop and bottom of the card
ActionsButtons in the header corner
Media / ImageUrlThe card image
Clickable / OnClickMakes the whole card clickable
DenseTighter spacing
razor
@using BzCore.Components.Card
@using BzCore.Components.Button
@using BzCore.Enums

<BzCard Variant="BzCardVariant.Gradient" Color="BzColor.Primary"
        Title="پلن طلایی" Icon="fa-solid fa-crown">
    <ChildContent><p>مثلا برا پلن vip و ... بدرد میخوره</p></ChildContent>
    <Footer><BzButton Size="BzSize.Small" Text="انتخاب" /></Footer>
</BzCard>

<BzCard Variant="BzCardVariant.Soft" Color="BzColor.Success"
        Title="موفقیت" Icon="fa-solid fa-check">
    <ChildContent><p>این یکی رنگ success برا کارت میزاره</p></ChildContent>
</BzCard>

<BzCard Variant="BzCardVariant.AccentStart" Color="BzColor.Danger"
        Title="هشدار مهم" Icon="fa-solid fa-bell">
    <ChildContent><p>نوار تایید کنارش هس</p></ChildContent>
</BzCard>

@*
Width="240px" pins a card to a fixed width instead of letting the grid size it.
A clickable card:
    <BzCard Clickable OnClick="@(() => Nav.NavigateTo("/details"))" ... />
*@