TrademarkTrademark
Docs
Ctrl k
Search docs...
Components

Media

Updated: October 18, 2026
View on GitHub
Soon
Not released yet. This is on main and is not in any published version yet. It will not install today.

Media shows an image from a URL in a box with rounded corners and a set aspect ratio. A skeleton fills the box until the image loads. It extends Flex props, so radius, border, margin and sizes work as on any Flex. See the web Media page for the web version.

Loading and caption

Set loading to show the skeleton instead of the image, for example while you fetch the URL. caption adds a line of text under the image.

Pressable

Pass onPress to make the image a button. onClick works too, as on the web. The image dims while it is pressed.

Stretch

With stretch, the image fills the box it is in and ignores aspectRatio. Use it for a background inside a sized container.

Differences from the web

  • Images only. The web's enlarge overlay, video and YouTube embeds are not in the native package.
  • aspectRatio defaults to "original", which takes the image's own ratio once it loads. Until then, the box is height rem tall, or the 80 spacing step when height is not set.
  • objectFit maps to React Native's resizeMode: cover and contain stay the same, fill becomes stretch, none becomes center and scale-down becomes contain.
  • An empty alt hides the image from screen readers, as on the web. With alt, the image is read out by it.
  • fillWidth is on by default.

API reference

Media extends Flex props, so spacing, radius, border, sizes and the rest apply.

Prop
Type
Default
Description
srcstringThe image URL. Required.
altstring""Read out by screen readers. Empty marks the image decorative.
aspectRatiostring"original""16 / 9", "1" and so on. "original" uses the image's own ratio once loaded.
heightnumberHeight in rem, used when there is no ratio yet.
loadingbooleanfalseShows the skeleton instead of the image.
objectFit"cover" | "contain" | "fill" | "none" | "scale-down""cover"How the image fits the box.
stretchbooleanfalseFills the parent box, ignoring aspectRatio.
captionReactNodeText shown under the image.
onPress() => voidMakes the image pressable.
onClick() => voidSame as onPress, the web name.
fillWidthbooleantrueTakes the full width of its parent.
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club