Skip to main content

Blazor Images

Make images responsive with Blazor Bootstrap so they never grow wider than their parent (IsResponsive), give them a rounded thumbnail border (IsThumbnail), and align them with classes.

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.

More libraries from the team

Free, open-source .NET libraries built by the same team.

UnlimitedPDF

A pure .NET library to create, merge and split PDFs, and convert HTML to PDF.

BlazorExpress.ChartJS

Chart.js charts for Blazor, configured in C#.

BlazorExpress.Bulma

Enterprise-class Blazor components built on the Bulma CSS framework.