logoEnterprise-level component library based on Bootstrap and Blazor
gitee
version
license
download
repo
commit
build
coverage

Card

Aggregate information to display in a card container

Card is a simple example

Demo
Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Go somewhere

You can show the content by adding the HeaderTemplate and FooterTemplate elements

Demo
Featured
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere

IsCenterIntro

Demo
Featured
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere

By setting, The makes the border and Body color appropriate

Demo
Header
Primary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
Secondary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
Success card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
Warning card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
Danger card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
Info card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
Dark card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Card body can collapse/expand by set IsCollapsible to true

Demo

Set Collapsed value to true for default collapsed card body.

Collapsible
Click card hader for collapse/expand card body
Collapsible
Header Template
Click card hader for collapse/expand card body
Click card hader for collapse/expand card body

Setting HeaderTemplate for custom CardHeader

Demo
CollapsibleHeader Template
Header Template

Enable shadow effect by set IsShadow to true

Demo
Shadow effect
Shadow effect sample

未设置

Demo
CollapsibleHeader Template
Click card hader for collapse/expand card body
Collapsible
Header Template
Click card hader for collapse/expand card body

Attributes

Loading...
@page "/cards"
@inject IStringLocalizer<Cards> Localizer

<h3>Card</h3>

<h4>Aggregate information to display in a card container</h4>

<DemoBlock Title="Card card components" Introduction="Card is a simple example" Name="Normal">
    <Card>
        <BodyTemplate>
            <h5>Card title</h5>
            <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
            <a class="btn btn-primary">Go somewhere</a>
        </BodyTemplate>
    </Card>
</DemoBlock>

<DemoBlock Title="Header 和 Footer" Introduction="You can show the content by adding the HeaderTemplate and FooterTemplate elements" Name="Footer">
    <Card>
        <HeaderTemplate>
            Featured
        </HeaderTemplate>
        <BodyTemplate>
            <h5>Special title treatment</h5>
            <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
            <a class="btn btn-primary">Go somewhere</a>
        </BodyTemplate>
        <FooterTemplate>
            2 days ago
        </FooterTemplate>
    </Card>
</DemoBlock>

<DemoBlock Title="@Localizer["IsCenterTitle"]" Introduction="@Localizer["IsCenterIntro"]" Name="IsCenter">
    <Card IsCenter="true">
        <HeaderTemplate>
            Featured
        </HeaderTemplate>
        <BodyTemplate>
            <h5>Special title treatment</h5>
            <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
            <a class="btn btn-primary">Go somewhere</a>
        </BodyTemplate>
        <FooterTemplate>
            2 days ago
        </FooterTemplate>
    </Card>
</DemoBlock>

<DemoBlock Title="A card with a border color" Introduction="By setting, <code>The</code> makes the border and Body color appropriate" Name="Color">
    <div class="row g-3">
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Primary" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Primary card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Secondary" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Secondary card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Success" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Success card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Warning" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Warning card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Danger" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Danger card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Info" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Info card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
        <div class="col-12 col-sm-6 col-lg-4 col-xl-2">
            <Card Color="Color.Dark" IsCenter="true">
                <HeaderTemplate>
                    Header
                </HeaderTemplate>
                <BodyTemplate>
                    <h5>Dark card title</h5>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                </BodyTemplate>
            </Card>
        </div>
    </div>
</DemoBlock>

<DemoBlock Title="Collapsible" Introduction="Card body can collapse/expand by set <code>IsCollapsible</code> to true" Name="Collapsible">
    <p>Set <code>Collapsed</code> value to <code>true</code> for default collapsed card body.</p>
    <Card IsCollapsible="true" HeaderText="Collapsible">
        <BodyTemplate>
            Click card hader for collapse/expand card body
        </BodyTemplate>
    </Card>
    <Card IsCollapsible="true" HeaderText="Collapsible" class="mt-3">
        <HeaderTemplate>
            Header Template
            <Select TValue="string" class="ms-1">
                <Options>
                    <SelectOption Text="Test1" Value="" />
                    <SelectOption Text="Test2" Value="1" />
                    <SelectOption Text="Test3" Value="2" />
                    <SelectOption Text="Test4" Value="3" />
                </Options>
            </Select>
        </HeaderTemplate>
        <BodyTemplate>
            Click card hader for collapse/expand card body
        </BodyTemplate>
    </Card>
    <Card IsCollapsible="true" HeaderText="Collapsible" class="mt-3" Collapsed="true">
        <BodyTemplate>
            Click card hader for collapse/expand card body
        </BodyTemplate>
    </Card>
</DemoBlock>

<DemoBlock Title="Header Template" Introduction="Setting <code>HeaderTemplate</code> for custom <code>CardHeader</code>" Name="HeaderTemplate">
    <Card HeaderText="Collapsible" class="mt-3">
        <HeaderTemplate>
            Header Template
            <Select TValue="string" class="ms-1">
                <Options>
                    <SelectOption Text="Test1" Value="" />
                    <SelectOption Text="Test2" Value="1" />
                    <SelectOption Text="Test3" Value="2" />
                    <SelectOption Text="Test4" Value="3" />
                </Options>
            </Select>
        </HeaderTemplate>
        <BodyTemplate>
            Header Template
        </BodyTemplate>
    </Card>
</DemoBlock>

<DemoBlock Title="Shadow effect" Introduction="Enable shadow effect by set <code>IsShadow</code> to true" Name="Shadow">
    <Card IsShadow="true" HeaderText="Shadow effect">
        <BodyTemplate>
            Shadow effect sample
        </BodyTemplate>
    </Card>
</DemoBlock>

<DemoBlock Title="对比设置" Name="compare">
    <Card IsCollapsible="false" HeaderText="Collapsible" class="mt-3">
        <HeaderTemplate>
            Header Template
            <Select TValue="string">
                <Options>
                    <SelectOption Text="Test1" Value="" />
                    <SelectOption Text="Test2" Value="1" />
                    <SelectOption Text="Test3" Value="2" />
                    <SelectOption Text="Test4" Value="3" />
                </Options>
            </Select>
        </HeaderTemplate>
        <BodyTemplate>
            Click card hader for collapse/expand card body
        </BodyTemplate>
    </Card>

    <Card IsCollapsible="true" HeaderText="Collapsible" class="mt-3">
        <HeaderTemplate>
            Header Template
            <Select TValue="string">
                <Options>
                    <SelectOption Text="Test1" Value="" />
                    <SelectOption Text="Test2" Value="1" />
                    <SelectOption Text="Test3" Value="2" />
                    <SelectOption Text="Test4" Value="3" />
                </Options>
            </Select>
        </HeaderTemplate>
        <BodyTemplate>
            Click card hader for collapse/expand card body
        </BodyTemplate>
    </Card>

</DemoBlock>

<AttributeTable Items="GetAttributes()" />
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

namespace BootstrapBlazor.Shared.Samples;

/// <summary>
/// Card展示组件
/// </summary>
public sealed partial class Cards
{
    /// <summary>
    /// Card属性
    /// </summary>
    /// <returns></returns>
    private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
    {
        new AttributeItem
        {
            Name = "BodyTemplate",
            Description = Localizer["BodyTemplate"],
            Type = "RenderFragment",
            ValueList = " — ",
            DefaultValue = " — "
        },
        new AttributeItem() {
            Name = "FooterTemplate",
            Description = Localizer["FooterTemplate"],
            Type = "RenderFragment",
            ValueList = " — ",
            DefaultValue = " — "
        },
        new AttributeItem
        {
            Name = "HeaderTemplate",
            Description = Localizer["HeaderTemplate"],
            Type = "RenderFragment",
            ValueList = " — ",
            DefaultValue = " — "
        },
        new AttributeItem
        {
            Name = "Class",
            Description = Localizer["Class"],
            Type = "string",
            ValueList = " — ",
            DefaultValue = " — "
        },
        new AttributeItem {
            Name = "Color",
            Description = Localizer["Color"],
            Type = "Color",
            ValueList = "None / Primary / Secondary / Success / Danger / Warning / Info / Light / Dark",
            DefaultValue = " — "
        },
        new AttributeItem {
            Name = "IsCenter",
            Description = Localizer["IsCenter"],
            Type = "boolean",
            ValueList = "true / false",
            DefaultValue = "false"
        },
        new AttributeItem
        {
            Name = "IsCollapsible",
            Description = Localizer["IsCollapsible"],
            Type = "boolean",
            ValueList = "true / false",
            DefaultValue = "false"
        },
        new AttributeItem
        {
            Name = nameof(Card.Collapsed),
            Description = Localizer["Collapsed"],
            Type = "boolean",
            ValueList = "true / false",
            DefaultValue = "false"
        },
        new AttributeItem
        {
            Name = "IsShadow",
            Description = Localizer["IsShadow"],
            Type = "boolean",
            ValueList = "true / false",
            DefaultValue = "false"
        }
    };
}

B station related video link

No

交流群

QQ Group:BootstrapAdmin & Blazor 795206915 675147445 Welcome to join the group discussion
img
Themes
Bootstrap
Motronic
Ant Design (完善中)
DevUI (制作中)
LayUI (完善中)
An error has occurred. This application may no longer respond until reloaded. Reload
Seems like the connection with the server has been lost. It can be due to poor or broken network. Please hang on while we're trying to reconnect...
Oh snap! Failed to reconnect with the server. This is typically caused by a longer network outage, or if the server has been taken down. You can try to reconnect, but if that does not work, you need to reload the page.
Oh man! The server rejected the attempt to reconnect. The only option now is to reload the page, but be prepared that it won't work, since this is typically caused by a failure on the server.
Bootstrap Blazor Component library updated to 7.0.8-beta05

Bootstrap Blazor at present has more than 120 components. This component is based on Bootstrap Blazor An enterprise-level component library that provides several types of common components such as layout, navigation, form, data, notification, icon, voice, etc. Each component has been carefully designed with modularity, responsiveness and excellent performance. Starting from more practical scenarios, meeting the needs of various scenarios, greatly reducing the time cost of developers, greatly shortening the development cycle, greatly improving development efficiency, and providing a set of General Rights Management System Example project。Bootstrap Blazor Products are maintained by a professional full-time technical team, with efficient response speed, diversified solutions, long-term support, and enterprise-level support. At present, it has been used in many well-known state-owned enterprises, and the project is running stably with a maximum of 1200 people online. On the right is the QR code of the Chinese Blazor QQ community with the largest number of people in China, welcome to scan and join the group.

component updated to 6.6.0 Change log [portal] If the component brings you convenience, please help to light up the project Star github gitee

QQGroup
QQ 795206915