The SVG component is used to display SVG (Scalable Vector Graphics) images. It supports loading SVG content from the following sources:
SVGs are rendered as bitmap images. You can choose to render them in template mode to apply tint colors using foregroundColor.
| Prop | Type | Description |
|---|---|---|
url |
string | DynamicImageSource<string> |
Displays an SVG from a network URL |
filePath |
string | DynamicImageSource<string> |
Displays an SVG from a local file path |
code |
string | DynamicImageSource<string> |
Displays an SVG from inline SVG code |
These three props are mutually exclusive — only one should be provided.
ImageRenderingBehaviorProps)| Prop | Type | Default | Description |
|---|---|---|---|
resizable |
boolean | object |
false |
Controls whether the image resizes to fit its frame (see below) |
renderingMode |
'original' | 'template' |
'original' |
Use "template" to allow tinting via foregroundColor |
interpolation |
'none' | 'low' | 'medium' | 'high' |
'medium' |
Sets interpolation quality when scaling the image |
antialiased |
boolean |
false |
Whether the image should use anti-aliasing |
widgetAccentedRenderingMode |
WidgetAccentedRenderingMode (Widget-only) |
— | Defines how the image renders in Widget accented mode |
resizable Prop Details| Type | Meaning |
|---|---|
true |
Image resizes to fit its container (stretch) |
false |
Image maintains original size |
{ capInsets, resizingMode } |
Allows defining cap insets and resizing mode (for 9-patch or tiled images) |
vectorDrawing prop has been removed and is no longer supported.renderingMode="template" along with foregroundColor.url, filePath, or code may be specified at a time.