Card

Flexible card containers with titles, icons, variants and footers.

NoHeader

NoHeader() removes the card header entirely — only the body is rendered.

NoHeader

A card without any header section.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().NoHeader().Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:A card without any header section.
            }
        }
    }
}

SetTitle

SetTitle(string, TitleLevel) renders a styled header with just a text label.

SetTitle

Settings

Default title at TitleLevel.Three.

Analytics

Title at TitleLevel.Five.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().SetTitle("Settings").Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Default title at TitleLevel.Three.
            }
        }
    }
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().SetTitle("Analytics", TitleLevel.Five).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Title at TitleLevel.Five.
            }
        }
    }
}

WithTitle + Icon + Subtitle

WithTitle(string, TitleLevel, IconStruct, string?) adds an icon and optional subtitle next to the title.

WithTitle + icon

Dashboard

Title with an icon, no subtitle.

Notifications

Last 30 days

Title, icon and subtitle.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().WithTitle("Dashboard", TitleLevel.Four, IconStruct.Bootstrap("bi-speedometer2")).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Title with an icon, no subtitle.
            }
        }
    }
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().WithTitle("Notifications", TitleLevel.Four, IconStruct.Bootstrap("bi-bell"), "Last 30 days").Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Title, icon and subtitle.
            }
        }
    }
}

WithIconOnly

WithIconOnly(TitleLevel, IconStruct) renders an icon-only header, optionally centered.

WithIconOnly

Centered icon header.

Favorites

Left-aligned icon with subtitle.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col3, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().WithIconOnly(TitleLevel.Two, IconStruct.Bootstrap("bi-gear")).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Centered icon header.
            }
        }
    }
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col3, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().WithIconOnly(TitleLevel.Two, IconStruct.Bootstrap("bi-star"), centered: false, subtitle: "Favorites").Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Left-aligned icon with subtitle.
            }
        }
    }
}

WithVariant

WithVariant(VariantStyle) colors the card header using Bootstrap contextual styles.

Primary

WithVariant(VariantStyle.Primary)

Success

WithVariant(VariantStyle.Success)

Danger

WithVariant(VariantStyle.Danger)

Info

WithVariant(VariantStyle.Info)

Warning

WithVariant(VariantStyle.Warning)

Secondary

WithVariant(VariantStyle.Secondary)

WithVariant

Primary

VariantStyle.Primary

Success

VariantStyle.Success

Danger

VariantStyle.Danger

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().SetTitle("Primary").WithVariant(VariantStyle.Primary).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:VariantStyle.Primary
            }
        }
    }
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().SetTitle("Success").WithVariant(VariantStyle.Success).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:VariantStyle.Success
            }
        }
    }
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().SetTitle("Danger").WithVariant(VariantStyle.Danger).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:VariantStyle.Danger
            }
        }
    }
}

Footer

FooterBuilder() inside a CardBuilder block renders a card-footer region below the body.

Footer

Report

Card body content.

C#
@using DMBBootstrapBuilder
@using DMBPageBuilder
@using (Html.RowBuilder().Begin())
{
    @using (Html.ColBuilder().SetCol(ColSize.Col12).SetCol(ColSize.Col4, ResponsiveBreakpoint.Md).Begin())
    {
        @using (Html.CardBuilder().SetTitle("Report").WithVariant(VariantStyle.Primary).Begin())
        {
            @using (Html.PB_P().AsMuted().Begin())
            {
                @:Card body content.
            }
            @using (Html.FooterBuilder().Begin())
            {
                @Html.Button(ActionItemFactory.Url("Download", "#", IconStruct.Bootstrap("bi-download")).SetVariant(VariantStyle.Primary)).Render()
            }
        }
    }
}