CardImage

in namespace DotVVM.Bootstrap5.Controls

Renders an image that is used inside the Card component.

Usage & Scenarios

Renders an image content inside the Card control.

https://getbootstrap.com/docs/5.2/components/card/#images-1

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

Properties

Name Type Description Notes Default Value
property icon AlternateText String Gets or sets the alt attribute value.
attribute
inner element
static value
bindable
default
null
property icon Height String Gets or sets the height attribute value.
attribute
inner element
static value
bindable
default
null
property icon ImageUrl String Gets or sets the src attribute value.
attribute
inner element
static value
bindable
default
null
property icon Overlay CardBody Gets or sets card body which overlays image.
attribute
inner element
static value
bindable
default
null
property icon ToolTip String Gets or sets the title attribute value.
attribute
inner element
static value
bindable
default
null
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True
property icon Width String Gets or sets the width attribute value.
attribute
inner element
static value
bindable
default
null

HTML produced by the control