Version: 2.0 |

CardBody

in namespace DotVVM.Framework.Controls.Bootstrap4

Properties

Name Type Description Notes Default Value
AddAppropriateCardClassesToContent Boolean Gets or sets whether appropriate classes (card-text, card-link, ...) should be added to inner elements. Can be used only when Content template is used.
attribute
inner element
static value
bindable
default
False
ContentTemplate ITemplate Gets or sets the contents of the main section of the panel.
attribute
inner element
static value
bindable
default
SubtitleText String Gets or sets subtitle of the card.
attribute
inner element
static value
bindable
default
Text String Gets or sets inner text of the card.
attribute
inner element
static value
bindable
default
TitleText String Gets or sets title of the card.
attribute
inner element
static value
bindable
default

Events

Name Type Description

Usage & Scenarios

Renders a text content inside the Card control.

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

HTML Rendered by the Control

Sample 1: Basic CardBody

Use the TitleText, SubtitleText and Text properties to provide two levels of title and a text content for the card.

<bs:Card>
  <bs:CardBody 
      TitleText="Main title"
      SubtitleText="Secondary title"
      Text="Body of the card" />
</bs:Card>

Sample 2: Templated CardBody

If you need to provide a custom content in the card body, place the content inside the control.

Bootstrap recommends the following CSS classes to be used in the card body templates:

  • h1, ..., h6 elements should have card-title or card-subtitle CSS classes.
  • p and other text elements should bave card-text CSS class.
  • a elements should have card-link CSS class.

You can set AddAppropriateCardClassesToContent property to true which makes the control to add the CSS classes automatically based on the rules mentioned above.

<bs:Card FooterText="Card Footer">
  <bs:CardImage ImageUrl="~/Content/Images/img11.jpg" ToolTip="Card Image">
    <bs:CardBody>
        <h1>Overlayed body</h1>
        <p>
            Another text
        </p>
    </bs:CardBody>
  </bs:CardImage>

  <bs:CardListGroup DataSource="{value: Texts}" TextBinding="{value: _this}" />

  <bs:CardBody>
      <p>Some buttons</p>
      <bs:RouteLink RouteName="Card_Advanced" Text="RouteLink" Type="Info" />
      <bs:Button Click="{command: null}" Text="Button" Type="Danger" />
  </bs:CardBody>
</bs:Card>

Suggestions


Help & Contribute

The documentation is maintained on GitHub.
We'll be happy if you edit the page and create a pull request.

Send message