Skip to content

ZoomableImage

A picture that zooms (pinch, ⌘-wheel, double-tap) and pans.

Group: Media · Kind: native

example
Screenshot

Open in the playground

The same specimen painted by React, SwiftUI, Compose and gpui.

exponential-ui-zoomable-image on Web
exponential-ui-zoomable-image on iOS
exponential-ui-zoomable-image on Android
exponential-ui-zoomable-image on Desktop
initial · auto
Screenshot
initial · fit
Screenshot
initial · fitWidth
Screenshot
initial · actual
Screenshot
controls · auto
Screenshot
controls · always
Screenshot
controls · none
Screenshot
Prop Type Required Bindable Description
src url yes yes The image URL.
alt string yes yes The accessibility description.
naturalWidth number – – Pixel width.
naturalHeight number – – Pixel height.
initial auto | fit | fitWidth | actual – – auto = fitWidth when tall. Default "auto".
maxScale number – – Largest zoom. Default 8.
controls auto | always | none – – The zoom pill. Default "auto".
scale number – yes 1 = 100%.
style style – – Extra Box styles for the viewport.
  • on.zoom: runs an action
  • on.tap: runs an action

None.

none

No basic catalog component maps here.

A native component: every renderer paints it directly.

Role: img

img (alt = name), focusable; the zoom pill’s buttons are named $string.zoomOut, $string.zoomIn, $string.zoomToFit (pressed while at rest) and the percent button $string.zoomLevel (its value = the percent, opening a menu whose first row is $string.zoomFit)

Keys Action
+ = zoom in a step
- zoom out a step
0 back to the opening zoom
1 100%

Recipe parts: ZoomableImage/root ZoomableImage/image ZoomableImage/pill ZoomableImage/zoomOut ZoomableImage/percent ZoomableImage/zoomIn ZoomableImage/divider ZoomableImage/fit

Keyed by: controls :hover :pressed :focus :disabled :checked :open :selected :invalid :dragover

Themes · Write a theme

Image · Icon · Video · AudioPlayer · Avatar · QrCode · Carousel · Mosaic