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.
Parameters
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| Alt | string? | null | Gets or sets the alternate text for the image. | 3.0.0 | |
| Src | string? | null | Gets or sets the source of the image. | 3.0.0 | |
| IsResponsive | bool | true | Gets or sets a value indicating whether the image is responsive. | 3.0.0 | |
| IsThumbnail | bool | false | Makes 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.
<Image Src="/images/placeholder.png" Alt="placeholder" />
Image thumbnails
To set the image to have a rounded 1px border appearance, set the IsThumbnail parameter to true.
<Image Src="/images/placeholder.png" IsThumbnail="true" Alt="placeholder" />
Aligning images
<Image Src="/images/placeholder.png" Class="rounded float-start" Alt="placeholder1" />
<Image Src="/images/placeholder.png" Class="rounded float-end" Alt="placeholder2" />
<Image Src="/images/placeholder.png" Class="rounded mx-auto d-block" Alt="placeholder" />
<div class="text-center">
<Image Src="/images/placeholder.png" Class="rounded" Alt="placeholder" />
</div>