Version: 2.0 |

CardImage

in namespace DotVVM.Framework.Controls.Bootstrap4

Properties

Name Type Description Notes Default Value
AlternateText String Gets or sets the alternate text of the image.
attribute
inner element
static value
bindable
default
Height String Gets or sets the height of the image.
attribute
inner element
static value
bindable
default
ImageUrl String Gets or sets the URL of the image.
attribute
inner element
static value
bindable
default
Overlay CardBody Gets or sets card body which overlays image
attribute
inner element
static value
bindable
default
ToolTip String Gets or sets the tool tip text of the image.
attribute
inner element
static value
bindable
default
Width String Gets or sets the width of the image.
attribute
inner element
static value
bindable
default

Events

Name Type Description

Usage & Scenarios

Renders an image content inside the Card control.

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

HTML Rendered by the Control

Sample 1: Basic CardImage

Use the ImageUrl property to provide URL of the image to be displayed.

You may use AlternateText and ToolTip properties to provide alt and title attributes to the image.

<bs:Card>
  <bs:CardImage
      ImageUrl="~/Images/losangeles.jpg"
      AlternateText="Los Angeles"
      ToolTip="Los Angeles" />
</bs:Card>

Sample 2: Textual Overlay

If you need to overlay the image with text, you can use CardBody control inside the CardImage.

<bs:Card>
  <bs:CardImage
      ImageUrl="~/Images/losangeles.jpg"
      AlternateText="Los Angeles"
      ToolTip="Los Angeles">
    <bs:CardBody 
        TitleText="Main title"
        SubtitleText="Secondary title"
        Text="Body of the card" />
  </bs:CardImage>
</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