Image
Displays an image from a gauge resource, such as a logo, decorative background, or tile texture. source Use the resource name to set the scaling, cropping, or repeating method to the available sizes.
Example
function main() {
return (
<Image
source="badge.png"
contentMode="fit"
repeatMode="none"
width={80}
height={80}
/>
);
}
Usage
- source names an image in the instrument bundle. original preserves its colors; color tints only template rendering. repeatMode tiles the image, not child Views. Use contentMode for normal image scaling.
- Numeric sizes use points. auto measures content; fill uses the space allocated by the parent. Size the container before tuning children. fill creates no extra space, and long text cannot enlarge a fixed parent.
Properties
sourcestringImage file name from the instrument’s bundled resources, not an SF Symbol name.
""contentMode?"fit" | "fill" | "stretch"fit preserves the whole image; fill covers the area and crops; stretch changes its aspect ratio.
"fit"repeatMode?"none" | "repeat" | "repeatX" | "repeatY"Tile at the image’s natural size: repeat on both axes, repeatX/repeatY on one, none for normal sizing.
"none"renderingMode?"original" | "template"original keeps image colors; template uses the color property to tint it.
"original"color?PaintDrawing color, including HDR colors.
HDR($env.foreground)contentAnimation?ContentAnimationTransition when content changes. Choose the type supported by this View; duration/delay use seconds.
{type: "fade", duration: 0.25}Common properties
width?number | "auto" | "fill"Width in points, auto sizing or parent fill.
100height?number | "auto" | "fill"Height in points, auto sizing or parent fill.
80padding?numberContent padding in points.
0x?numberVisual offset in points: x moves right, y moves down. Does not change layout space.
0y?numberVisual offset in points: x moves right, y moves down. Does not change layout space.
0transform?ViewTransformTransform the whole View without changing layout. Translation uses points; rotation/skew use degrees; scale 1 is unchanged; anchors use 0–1.
{rotation: 0}background?PaintBackground paint; accepts a color or gradient. Use clear for transparency.
"clear"opacity?numberOpacity of the whole View: 0 is transparent, 1 is opaque.
1cornerRadius?numberCorner radius in points.
0clipped?booleanClip drawing that extends beyond the View bounds.
falseclip?"rectangle" | "ellipse"Clipping shape: rectangle or ellipse. Material also accepts false to disable clipping.
"rectangle"mask?View | nullAlpha mask View. Centered without affecting layout; null disables masking.
<Circle width="fill" height="fill" background="white"/>zIndex?numberDrawing order among siblings; larger values appear in front.
0blur?numberBlur radius in points; 0 disables blur.
4innerShadow?DrawingEffectEffect color, opacity, blur radius and x/y offset. Distances are in points.
{color: HDR("black"), opacity: 0.5, radius: 4, x: 0, y: 2}glow?DrawingEffectEffect color, opacity, blur radius and x/y offset. Distances are in points.
{color: HDR("cyan"), radius: 8, opacity: 0.8}shadowColor?ColorColor of the outer shadow.
HDR("black")shadowOpacity?numberOuter shadow opacity from 0 to 1; 0 hides it.
0shadowRadius?numberOuter shadow blur radius in points.
4shadowX?numberOuter shadow offset in points: x right, y down.
0shadowY?numberOuter shadow offset in points: x right, y down.
2animations?Animation[]Animate a supported property when it changes. duration/delay use seconds; from/to set endpoints; repeat and autoreverse control repetition; wrap sets a periodic range.
[{property: "opacity", duration: 0.25, curve: "easeInOut"}]key?string | numberStable identity among siblings.
Practical example
function main() {
return (
<HStack spacing={12}>
<Image source="badge.png" width={80} height={80} contentMode="fit" />
<Image
source="badge.png"
width={80}
height={80}
renderingMode="template"
color={$env.accent}
/>
</HStack>
);
}
Animation
widthheightpaddingxyopacitybackgroundcornerRadiusblurshadowColorshadowOpacityshadowRadiusshadowXshadowYcolortransform.translateXtransform.translateYtransform.scaleXtransform.scaleYtransform.rotationtransform.skewXtransform.skewYtransform.anchorXtransform.anchorYWhen omitted
The table lists omission behavior verified against implementation. Property examples are copyable syntax, not defaults. Pass explicit values for a fixed result; contextual dimensions and theme colors are not fixed constants.
| Properties | When omitted |
|---|---|
contentMode | "fit" |
repeatMode | "none" |
renderingMode | "original" |
color | HDR($env.foreground) |