Image

in namespace DotVVM.Framework.Controls.Bootstrap4

Renders an image and allows to apply Bootstrap CSS classes.

Usage & Scenarios

Renders an image and allows to apply Bootstrap CSS classes - e.g. rounded corners, circle crop etc.

https://getbootstrap.com/docs/4.3/content/images/

Sample 1: Basic Image

The most important property is the ImageUrl which sets the src attribute of the rendered image.

The Image control has the ToolTip and AlternateText properties which set the title and alt attributes.

There are also Width and Height properties which apply the width and a height of the image using inline CSS styles.

<bs:Image ImageUrl="~/Images/LA.jpg" 
          AlternateText="Los Angeles" 
          Height="50%" Width="50%" />

Sample 2: Image Types

The Type property specifies which type of the image should be rendered.

The available types are:

  • Default
  • Thumbnail
  • Responsive
  • Rounded
  • Circle
<bs:Image ImageUrl="~/Images/LA.jpg" AlternateText="Los Angeles" />
<br/>
<bs:Image ImageUrl="~/Images/LA.jpg" AlternateText="Los Angeles" 
          Type="Thumbnail" />
<br/>
<bs:Image ImageUrl="~/Images/LA.jpg" AlternateText="Los Angeles" 
          Type="Responsive" />
<br/>
<bs:Image ImageUrl="~/Images/LA.jpg" AlternateText="Los Angeles" 
          Type="Rounded" />
<br/>
<bs:Image ImageUrl="~/Images/LA.jpg" AlternateText="Los Angeles" 
          Type="Circle" />

Properties

Name Type Description Notes Default Value
property icon AlternateText String Gets or sets the alternate text of the image.
attribute
inner element
static value
bindable
default
null
property icon Height String Gets or sets the height of the image.
attribute
inner element
static value
bindable
default
null
property icon ImageUrl String Gets or sets the URL of the image.
attribute
inner element
static value
bindable
default
null
property icon ToolTip String Gets or sets the tool tip text of the image.
attribute
inner element
static value
bindable
default
property icon Type ImageType Gets or sets the type of the image - e.g. rounded, circle, responsive etc.
attribute
inner element
static value
bindable
default
Default
property icon Width String Gets or sets the width of the image.
attribute
inner element
static value
bindable
default
null

HTML produced by the control