Skip to main content
v0.1.0A Nitro module for NitroUI on iOS and Android

Capture views
as native images.

Wrap NitroUI content in a ViewShotView, call capture(), and get a native Image at the display's pixel density, drawn by Swift and Kotlin.

$bun add nitro-view-shot

Two ways to capture

Wrap the content you own, or capture any NitroUI View you hold a ref to. Both resolve to the same Image.

What a capture includes

The same behavior on iOS and Android, pinned by native tests that read pixel colors.

One call, one Image

The result is a nitro-ui-renderer Image: show it, encode it as PNG or JPEG, save it, or read its pixels.

Read the guides
const shot = useRef<ViewShotViewRef>(null)

<ViewShotView ref={shot} style={{ background: 'white' }}>
<Text>Captured content</Text>
</ViewShotView>

const image = await shot.current?.capture()
const png = await image?.toEncodedImageDataAsync('png')
2
Entry points
4
Documented errors
16+
iOS minimum
26+
Android API minimum

Capture your first view

Add the package, pin nitro-core, run nitro-ui prepare, and wrap a view.

Start the setup