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.
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 | |
---|---|---|---|---|---|
AlternateText | String | Gets or sets the alt attribute value. |
attribute
static value
bindable
|
null | |
ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
Static | |
DataContext | Object | Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value. The DataContext is null in client-side templates. |
attribute
bindable
|
null | |
Height | String | Gets or sets the height attribute value. |
attribute
static value
|
null | |
ID | String | Gets or sets the control client ID within its naming container. |
attribute
static value
bindable
|
null | |
ImageUrl | String | Gets or sets the src attribute value. |
attribute
static value
bindable
|
null | |
IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
Overlay | CardBody | Gets or sets card body which overlays image. |
inner element
static value
default
|
null | |
ToolTip | String | Gets or sets the title attribute value. |
attribute
static value
bindable
|
null | |
Visible | Boolean | Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control. |
attribute
static value
bindable
|
True | |
Width | String | Gets or sets the width attribute value. |
attribute
static value
|
null |