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

react-native-multidevice-preview

v1.0.0

Published

Developer tool to preview React Native UI across multiple device sizes, notches, and orientations

Readme

react-native-multidevice-preview

Developer tool to preview React Native UI across multiple device sizes, notches, and orientations — all in a single screen.


Installation

npm install react-native-multidevice-preview react-native-safe-area-context
# or
yarn add react-native-multidevice-preview react-native-safe-area-context

Quick Start

Wrap your application's root component or any individual screen in <DevicePreview> to render it inside a simulated device frame.

import { DevicePreview } from 'react-native-multidevice-preview';
import App from './App';

export default function PreviewScreen() {
  return (
    <DevicePreview device="iPhone14" orientation="portrait">
      <App />
    </DevicePreview>
  );
}

Detailed Examples

These examples demonstrate various ways to use react-native-multidevice-preview effectively:

Example 1: Basic Usage with Controls

By default, the device frame comes with interactive controls to toggle device, orientation, safe areas, and notch visibility on the fly.

<DevicePreview
  device="iPhone14"
  orientation="portrait"
  scale="auto" // Scales automatically to fit parent container 
  showControls={true}
  showNotch={true}
  backgroundColor="#e8e8f0"
>
  <YourApp />
</DevicePreview>

Example 2: Comparing Multiple Devices Side-by-Side

You can compare your application against multiple device sizes at the same time using <DevicePreview.Group>.

<DevicePreview.Group orientation="portrait" scale={0.45} gap={24}>
  <DevicePreview device="iPhoneSE3">
    <YourApp />
  </DevicePreview>

  <DevicePreview device="iPhone14">
    <YourApp />
  </DevicePreview>

  <DevicePreview device="pixel6">
    <YourApp />
  </DevicePreview>
</DevicePreview.Group>

Example 3: Landscape Mode

Simply change the orientation prop to preview your application in landscape mode.

<DevicePreview
  device="iPhone14"
  orientation="landscape"
  showControls={true}
>
  <YourApp />
</DevicePreview>

Example 4: Context and Custom Controls (Advanced)

If you build custom developer tooling, you can interact with the current device sizing using the useDevicePreview() hook.

import { useDevicePreview } from 'react-native-multidevice-preview';

function MyControls() {
  const { toggleOrientation, toggleNotch } = useDevicePreview();

  return (
    <View>
      <Button title="Rotate" onPress={toggleOrientation} />
      <Button title="Toggle Notch" onPress={toggleNotch} />
    </View>
  );
}

API

<DevicePreview />

Wraps any component and renders it inside a simulated device frame.

| Prop | Type | Default | Description | |---|---|---|---| | device | DeviceKey | "iPhone14" | Device to simulate | | orientation | "portrait" \| "landscape" | "portrait" | Screen orientation | | scale | number \| "auto" | "auto" | Scale factor (auto fits container) | | showFrame | boolean | true | Show device chrome | | showNotch | boolean | true | Show notch / Dynamic Island | | showSafeArea | boolean | false | Show safe area guide overlay | | showControls | boolean | true | Show floating device switcher panel | | backgroundColor | string | "#f0f0f5" | Background behind the device | | customDevice | DeviceConfig | — | Fully custom device spec |

<DevicePreview.Group />

Renders multiple device previews in a horizontal scroll row for side-by-side comparison.

| Prop | Type | Default | Description | |---|---|---|---| | orientation | "portrait" \| "landscape" | — | Shared orientation for all devices | | scale | number \| "auto" | 0.5 | Shared scale for all devices | | gap | number | 20 | Gap between devices in px | | wrap | boolean | false | Wrap to next row |


Supported Devices

iPhone

| Key | Name | Size | |---|---|---| | iPhone14 | iPhone 14 | 390 × 844 | | iPhone14Pro | iPhone 14 Pro | 393 × 852 | | iPhone14ProMax | iPhone 14 Pro Max | 430 × 932 | | iPhoneSE3 | iPhone SE (3rd gen) | 375 × 667 | | iPhone8 | iPhone 8 | 375 × 667 |

Android

| Key | Name | Size | |---|---|---| | pixel6 | Pixel 6 | 393 × 851 | | pixel7Pro | Pixel 7 Pro | 412 × 892 | | samsungS22 | Samsung S22 | 360 × 780 | | samsungS22Ultra | Samsung S22 Ultra | 384 × 824 |

Tablets

| Key | Name | Size | |---|---|---| | iPadMini | iPad Mini (6th gen) | 744 × 1133 | | iPadPro11 | iPad Pro 11" | 834 × 1194 | | genericTablet | Generic Tablet | 768 × 1024 |


Custom Device Config

<DevicePreview
  customDevice={{
    name: 'My Custom Device',
    brand: 'generic',
    width: 360,
    height: 760,
    safeArea: { top: 32, bottom: 16, left: 0, right: 0 },
    hasNotch: true,
    hasDynamicIsland: false,
    frameRadius: 24,
    statusBarHeight: 32,
    platform: 'android',
  }}
>
  <YourApp />
</DevicePreview>

License

MIT