Card

in namespace DotVVM.Framework.Controls.Bootstrap4

Renders the Bootstrap panel.

Usage & Scenarios

Renders the Bootstrap card with flexible content options. The card can contain one of more content items:

https://getbootstrap.com/docs/4.3/components/card/

Sample 1: Basic Card

The contents of the card are just placed inside the control element.

You can use HeaderText or HeaderTemplate, and FooterText or FooterTemplate properties to specify contents of the card header and footer bar.

To provide a text content, use CardBody control.

<bs:Card FooterText="Card Footer">
  <HeaderTemplate>
    <h1>Header</h1>
  </HeaderTemplate>

  <bs:CardBody Text="Body of the card" />
</bs:Card>

Sample 2: Card with images and lists

The card can contain images or lists. Use any combination of CardBody, CardImage and CardListGroup controls.

<bs:Card FooterText="Card Footer">
  <bs:CardImage ImageUrl="~/images/LA.jpg" ToolTip="Card Image">
    <bs:CardBody style="color:aliceblue;">
      <h1>Overlaid body</h1>
      <p>
          Another text
      </p>
      <p>Some buttons</p>
      <bs:Button Click="{command: DoSomething()}" Text="Button" Type="Danger" />
    </bs:CardBody>
  </bs:CardImage>
  
  <bs:CardListGroup DataSource="{value: Texts}" TextBinding="{value: _this}" />

</bs:Card>
public class ViewModel : DotvvmViewModelBase
{

    public string[] Texts { get; } = new[] { "red", "green", "blue" };

    public void DoSomething() 
    {

    }
}

Properties

Name Type Description Notes Default Value
property icon Content List<ICardItem> Gets or sets the contents of the main section of the panel.
attribute
inner element
static value
bindable
default
null
property icon FooterTemplate ITemplate Gets or sets the contents of the footer section of the panel.
attribute
inner element
static value
bindable
default
null
property icon FooterText String Gets or sets footer text
attribute
inner element
static value
bindable
default
null
property icon HeaderTemplate ITemplate Gets or sets the contents of the header section of the panel.
attribute
inner element
static value
bindable
default
null
property icon HeaderText String Gets or sets header text.
attribute
inner element
static value
bindable
default
null
property icon SubtitleText String Gets or sets subtitle of the card.
attribute
inner element
static value
bindable
default
null
property icon Text String Gets or sets inner text of the card.
attribute
inner element
static value
bindable
default
null
property icon TitleText String Gets or sets title of the card.
attribute
inner element
static value
bindable
default
null

HTML produced by the control