Visual Elements & Typography (Android)

Static or decorative elements used to display content on Android widgets. See Styling for details on supported style properties.

Text

Displays text content.

Parameters:

  • maxLines (number, optional): Maximum number of lines to display.
  • renderAsBitmap (boolean, optional): Renders text as a bitmap image to enable custom fonts. Requires fontFamily in the style prop.

Image

Displays bitmap images from the asset catalog, preloaded runtime cache, or base64 encoded data. SVGs should be rasterized through the image preloading API and referenced by assetName.

Parameters:

  • source (object, optional): Image source object.
    • assetName (string): Reference to a pre-bundled image (drawable resource) or a preloaded image.
    • base64 (string): Base64 encoded image data.
  • resizeMode (string, optional): "cover", "contain", "stretch", "repeat", or "center".
  • contentDescription (string, optional): Accessibility description for the image.
  • contentScale (string, optional): Glance-specific scaling mode: "crop", "cover", "fit", "contain", "fill-bounds", or "stretch".
  • alpha (number, optional): Opacity value from 0.0 to 1.0.
  • colorFilter (string, optional): Color tint filter for the image.
  • tintColor (string, optional): Legacy alias for colorFilter.
  • fallback (ReactNode, optional): Custom content rendered when the image is missing.

Styling the fallback:

To add a background color when an image is missing, use backgroundColor in the style prop:

<Image
  source={{ assetName: 'photo' }}
  style={{ backgroundColor: '#E0E0E0', borderRadius: 12 }}
/>
Image Preloading

For dynamic images from remote URLs, use the Image Preloading API to cache them locally for use in widgets.

Need React or React Native expertise you can count on?