xray-react weekly downloads statistics
By loogle18 · npm · Webpack plugins
React layout debugger inspired by Xray-rails.
xray-react has 47 recorded weekly downloads on npm, a decrease of 20.3% over the past 30 days, ranking #2786 of 3,247 tracked listings.
About xray-react

X-Ray React
React UI layout debugging tool inspired by Xray-rails
Overview
Xray-react is a development tool that reveals your React UI's component structure. Press Cmd+Shift+X (Mac) or Ctrl+Shift+X (Windows/Linux) to reveal an overlay of the React components that rendered your UI, and click any component to open its source file in your editor.
Full Mode (default)

Simple Mode

Features
- React 18+ Support - Works with React 18+ using React DevTools protocol, with fallback support for React <18
- Multi-Bundler Support - Works with Webpack and Vite
- TypeScript Support - Supports
.js,.jsx,.ts, and.tsxfiles - Smart Component Filtering - Automatically filters out external library components, showing only your project's components
- Component Hierarchy Display - Shows full component path from parent to child (e.g.,
Page -> Layout -> Component) - Modern UI - Clean overlay interface with component search and scrollable component paths
- Editor Integration - Automatic detection for VSCode, WebStorm, Cursor, Sublime, and more
- Fast & Lightweight - Minimal performance impact
Requirements
- Node.js: >= 22.0.0
- React: >= 16.0.0 (React 18+ recommended for best experience)
Installation
npm install --save-dev xray-react
Usage
Webpack
// webpack.config.js
import { XrayReactWebpackPlugin } from 'xray-react';
export default {
// ... your config
plugins: [
// ... other plugins
...(process.env.NODE_ENV === 'development' ? [
new XrayReactWebpackPlugin({
output: 'bundle.js', // optional: specify output filename
server: true, // optional: enable Socket.IO server (default: true)
sourcePath: '/path/to/src', // optional: specify source path
port: 9000, // optional: specify port (default: 8124)
mode: 'full' // optional: 'full' or 'simple' (default: 'full')
})
] : [])
]
};
Legacy export (backward compatibility):
const { XrayReactPlugin } = require('xray-react');
// XrayReactPlugin is an alias for XrayReactWebpackPlugin
Vite
// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { xrayReactVitePlugin } from 'xray-react';
export default defineConfig(({ mode }) => ({
plugins: [
react(),
...(mode === 'development' ? [
xrayReactVitePlugin({
server: true, // optional: enable Socket.IO server (default: true)
sourcePath: '/path/to/src', // optional: specify source path
port: 9000, // optional: specify port (default: 8124)
mode: 'full' // optional: 'full' or 'simple' (default: 'full')
})
] : [])
]
}));
Next.js
For Next.js applications, you can use either the webpack plugin or manual imports.
Using Webpack Plugin
The webpack plugin automatically detects Next.js client builds and injects scripts into the appropriate chunks.
Configure xray-react in next.config.js:
// next.config.js
import { XrayReactWebpackPlugin } from 'xray-react';
export default {
webpack: (config, { dev, isServer }) => {
if (dev && !isServer) {
config.plugins.push(
new XrayReactWebpackPlugin({
server: true, // optional: enable Socket.IO server (default: true)
sourcePath: process.cwd(), // optional: specify source path
port: 9000, // optional: specify port (default: 8124)
mode: 'full' // optional: 'full' or 'simple' (default: 'full')
})
);
}
return config;
}
};
Manual Import (Without Plugin)
If you're not using a bundler plugin, you can manually import the UI:
// app/_app.tsx or your application entry point
import { useEffect } from 'react';
export default function App({ Component, pageProps }) {
useEffect(() => {
if (process.env.NODE_ENV === 'development') {
import('xray-react/lib/xray-react-ui');
import('xray-react/lib/xray-react-client'); // Optional: for file opening functionality
}
}, []);
return <Component {...pageProps} />;
}
Note: When using manual import, the Socket.IO server won't be started automatically. You'll need to run the standalone server separately (see Standalone Server below).
Standalone Server
For manual imports or local development, you can run the xray-react server separately:
# From your React project root
cd /path/to/your/react-project
# Option 1: Set project root via environment variable
XRAY_REACT_PROJECT_ROOT=$(pwd) node node_modules/xray-react/server.js
# Option 2: Run from project root (auto-detects via package.json)
node node_modules/xray-react/server.js
# Option 3: If using npm link for local development
XRAY_REACT_PROJECT_ROOT=$(pwd) npm run server --prefix /path/to/xray-react
The server will:
- Auto-detect your project root (via
package.jsonorXRAY_REACT_PROJECT_ROOTenv var) - Scan your source files to build component mappings
- Start Socket.IO server for file opening
- Send project configuration to connected clients
Note: The client bundle dynamically loads Socket.IO from a CDN, so an internet connection is required for file opening functionality.
Configuration
Environment Variables…
Description from the npm listing.
- component-inspector
- css
- debug
- debugging
- development
- development-tool
- devtools
- inspector
- layout
- nextjs
- react
- react-component
- react-inspector
- reactjs
- style
- typescript
- ui
- vite
- vite-plugin
- webpack
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Webpack plugins plugins
All 20 xray-react alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/xray-react. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.