npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-dual-camera

v55.2.13

Published

Native dual camera support using AVCaptureMultiCamSession for iOS and CameraX for Android

Downloads

165

Readme

expo-dual-camera

Native dual camera support for Expo apps using AVCaptureMultiCamSession (iOS) and CameraX (Android).

Features

  • True simultaneous front and back camera capture
  • Two standalone components — style them like any React Native view
  • Standard ViewStyle props: position, borderRadius, zIndex, overflow all just work
  • Back camera lens selection: wide, ultra-wide, telephoto
  • iOS 13+ with AVCaptureMultiCamSession
  • Android API 24+ with CameraX

Installation

npx expo install expo-dual-camera

Usage

import { DualCameraFront, DualCameraBack, isSupported } from "expo-dual-camera";
import { StyleSheet, View } from "react-native";

Picture-in-Picture

<View style={styles.container}>
  <DualCameraBack style={StyleSheet.absoluteFill} />
  <DualCameraFront style={styles.pip} />
</View>

Swapped PiP (front big, back small)

<View style={styles.container}>
  <DualCameraFront style={StyleSheet.absoluteFill} />
  <DualCameraBack style={styles.pip} lens="ultraWide" />
</View>

Side by Side

<View style={styles.container}>
  <DualCameraBack style={styles.left} />
  <DualCameraFront style={styles.right} />
</View>

With Other React Native Views

<View style={styles.container}>
  <DualCameraBack style={StyleSheet.absoluteFill} />
  <DualCameraFront style={styles.pip} />
  <Text style={styles.label}>Recording...</Text>
  <TouchableOpacity style={styles.button} onPress={capture}>
    <View style={styles.captureCircle} />
  </TouchableOpacity>
</View>

Example Styles

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#000",
  },
  pip: {
    position: "absolute",
    top: 60,
    right: 20,
    width: 120,
    height: 160,
    borderRadius: 12,
    overflow: "hidden",
  },
  left: {
    position: "absolute",
    top: 0,
    left: 0,
    width: "50%",
    height: "100%",
  },
  right: {
    position: "absolute",
    top: 0,
    right: 0,
    width: "50%",
    height: "100%",
  },
});

Components

<DualCameraBack />

Renders the back (rear) camera preview.

| Prop | Type | Default | Description | | ------- | -------------------------------------- | -------- | --------------------------------------------------------------------------------- | | style | StyleProp<ViewStyle> | — | Standard React Native styles | | lens | 'wide' \| 'ultraWide' \| 'telephoto' | 'wide' | Physical lens to use (iOS selects the actual lens; Android approximates via zoom) |

<DualCameraFront />

Renders the front (selfie) camera preview.

| Prop | Type | Default | Description | | ------- | ---------------------- | ------- | ---------------------------- | | style | StyleProp<ViewStyle> | — | Standard React Native styles |

Session Lifecycle

The camera session starts automatically when both DualCameraFront and DualCameraBack are mounted, and stops when either is unmounted. No manual start/stop is needed.

Functions

isSupported()

Returns Promise<boolean> indicating whether the device supports simultaneous dual camera capture.

const supported = await isSupported();
if (!supported) {
  // Fall back to single camera
}

Lens Selection (iOS)

On iOS, lens selects the physical camera lens:

| Value | Lens | Approx. zoom | | ------------- | ----------------------------- | ------------ | | 'wide' | Built-in wide angle (default) | 1× | | 'ultraWide' | Built-in ultra wide angle | 0.5× | | 'telephoto' | Built-in telephoto | 2×–5× |

Not all devices have all lenses. If the requested lens isn't available, it falls back to wide angle.

On Android, lens is approximated using CameraX zoom ratios on the default back camera.

Permissions

Camera permissions must be granted before the views will display a preview. Use expo-camera's permission APIs or handle permissions in your app before rendering the components.

Requirements

  • iOS 13+ on a device that supports AVCaptureMultiCamSession (iPhone XS and later)
  • Android API 24+ with CameraX concurrent camera support
  • Requires a development build — does not work in Expo Go

License

MIT