Skip to content

Preview selected components from your React Native app in isolation, directly from DevTools. Ideal for rapid UI prototyping, component testing, or debugging in complex apps.

Notifications You must be signed in to change notification settings

matinzd/rozenite-preview

Repository files navigation

Rozenite Preview

semantic-release: angular npm latest version npm beta version npm alpha version

A Rozenite plugin that lets you select React Native components in DevTools and preview them live on your simulator. Ideal for rapid UI development, component testing, and debugging complex apps.

Powered by Rozenite:
A comprehensive toolkit for creating, developing, and integrating custom plugins into React Native DevTools.

Features

  • 🔍 Instantly select and debug any registered React Native component from DevTools and view it on device/simulator
  • ⚡ Rapid UI prototyping and visual debugging
  • 🧩 Simple API for registering components to preview
  • 🛠️ Built as a Rozenite plugin for seamless DevTools integration

Installation

bun add -D rozenite-preview@beta
# or
npm install --save-dev rozenite-preview@beta
# or
yarn add -D rozenite-preview@beta

Configuration

Add the following to your babel.config.js to get more insights and metadata in your previews:

module.exports = {
  presets: ["module:metro-react-native-babel-preset"],
  plugins: ["rozenite-preview/babel-plugin"]
};

Usage

  1. Register your components for preview:
import { registerPreview } from "rozenite-preview";

registerPreview("MyButton", MyButton);
registerPreview("UserCard", UserCard);
  1. Wrap your app with the preview host:
import { PreviewHost } from "rozenite-preview";

export default function App() {
  return <PreviewHost>{/* your app */}</PreviewHost>;
}
  1. Open React Native DevTools and use the "Preview" panel
    Select and interact with your registered components in real time.

Demo

rozenite-preview-demo.mov

API

  • registerPreview(name: string, component: React.ComponentType)
  • PreviewHost – React component to enable previewing

Requirements

  • React Native 0.79+
  • React 19+
  • Node 18+

License

MIT

About

Preview selected components from your React Native app in isolation, directly from DevTools. Ideal for rapid UI prototyping, component testing, or debugging in complex apps.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published