Skip to main content

Blazor Images

Documentation and examples for opting images into responsive behavior (so they never become wider than their parent) and add lightweight styles to them.

Blazor Bootstrap: Image Component

Parameters

NameTypeDefaultRequiredDescriptionAdded Version
Altstring?nullGets or sets the alternate text for the image.3.0.0
Srcstring?nullGets or sets the source of the image.3.0.0
IsResponsivebooltrueGets or sets a value indicating whether the image is responsive.3.0.0
IsThumbnailboolfalseMakes the image have a rounded 1px border appearance if set to true.3.0.0

Examples

Images

By default images are responsive. The default value of the IsResponsive parameter is true.

Blazor Bootstrap: Image Component
<Image Src="/images/placeholder.png" Alt="placeholder" />

See demo here.

Image thumbnails

To set the image to have a rounded 1px border appearance, set the IsThumbnail parameter to true.

Blazor Bootstrap: Image Component - Image thumbnails
<Image Src="/images/placeholder.png" IsThumbnail="true" Alt="placeholder" />

See demo here.

Aligning images

Blazor Bootstrap: Image Component - Aligning images
<Image Src="/images/placeholder.png" Class="rounded float-start" Alt="placeholder1" />
<Image Src="/images/placeholder.png" Class="rounded float-end" Alt="placeholder2" />
Blazor Bootstrap: Image Component - Aligning images
<Image Src="/images/placeholder.png" Class="rounded mx-auto d-block" Alt="placeholder" />
Blazor Bootstrap: Image Component - Aligning images
<div class="text-center">
<Image Src="/images/placeholder.png" Class="rounded" Alt="placeholder" />
</div>

See demo here.