CardImage
in namespace DotVVM.Framework.Controls.Bootstrap4
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 alternate text of the image. |
attribute
static value
bindable
|
null | |
Attributes | Dictionary<String,Object> |
attribute
static value
|
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. |
attribute
bindable
|
null | |
Height | String | Gets or sets the height of the image. |
attribute
static value
bindable
|
null | |
ID | String | Gets or sets the unique control ID. |
attribute
static value
bindable
|
null | |
ImageUrl | String | Gets or sets the URL of the image. |
attribute
static value
bindable
|
null | |
IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
InnerText | String | Gets or sets the inner text of the HTML element. |
attribute
static value
bindable
|
null | |
Overlay | CardBody | Gets or sets card body which overlays image |
inner element
static value
default
|
null | |
ToolTip | String | Gets or sets the tool tip text of the image. |
attribute
static value
bindable
|
||
Visible | Boolean | Gets or sets whether the control is visible. |
attribute
bindable
|
True | |
Width | String | Gets or sets the width of the image. |
attribute
static value
bindable
|
null |