ComponentsData display
Image
MudImage renders an img with theme-aware elevation, fluid sizing and object-fit control. Use it for photographs and illustrations; every image needs alt text, or an empty alt when it is decorative.
Fixed and fluid sizes
Width and Height set the image's size in pixels. Fluid scales it to the container's width instead, keeping the aspect ratio.
Width="240" Height="135"
Fluid="true" fills the column
Every fit and position
ObjectFit × ObjectPosition for a wide picture in a square frame. Fill stretches; Cover crops; Contain and ScaleDown letterbox; None keeps the natural size. Position chooses which part stays visible.
| ObjectPosition ↓ · ObjectFit → | None | Cover | Contain | Fill | ScaleDown |
|---|---|---|---|---|---|
| Center | |||||
| Top | |||||
| Bottom | |||||
| Left | |||||
| LeftTop | |||||
| LeftBottom | |||||
| Right | |||||
| RightTop | |||||
| RightBottom |
Elevation and shape
Elevation adds a shadow. Rounded corners come from the border-radius utility classes, and rounded-circle turns a square crop into a portrait disc.
Fallback source
When Src fails to load, FallbackSrc replaces it. Keep the fallback local so it cannot fail for the same reason.
An exhibition grid
Uniform thumbnails from mixed artwork: Cover with a fixed height fills each frame, and figure captions name every piece.
Playground
Change any parameter; the markup below updates with only the values that differ from the defaults.
<MudImage
Src="@source"
Alt="Green hills under a pale sky, with a red cottage"
Width="200"
Height="200"
ObjectFit="ObjectFit.Cover"
ObjectPosition="ObjectPosition.Left"
Elevation="2"
Class="rounded-lg" />