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

@jfdevelops/react-layout-devtools-vite

v1.0.0

Published

Opt-in Vite development source locations and render-state previews for react-layout.

Readme

React Layout Devtools — Vite

Optional development instrumentation for React Layout Devtools. The plugin adds source locations and enables temporary render-state previews. It is not required by the library or by the React inspector.

pnpm add -D @jfdevelops/react-layout-devtools-vite
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { reactLayoutDevtools } from '@jfdevelops/react-layout-devtools-vite';

export default defineConfig({
  plugins: [react(), reactLayoutDevtools()],
});

Continue passing your definition or factory to <ReactLayoutDevtools source={...} /> or <ReactLayoutDevtoolsContent source={...} />. No provider or changes to existing layout calls are needed.

Source locations

The selected-node panel shows declaration and registration locations when they differ. Clicking a file location opens it using Vite's development editor endpoint and its editor configuration (LAUNCH_EDITOR when needed). Paths displayed in the panel are relative to the Vite root. Editor requests stay on the development server origin.

The transform recognizes named imports (including aliases), namespace imports, factory helpers, forResources/forResource bindings, and inline render states. Metadata travels with imported state definitions, including spread fragments. Composable definitions created through the library's helpers carry their own locations. Arbitrary third-party components and dynamically computed API calls may not have a discoverable declaration location; the plugin does not guess it.

Render-state previews

Select a mounted layout or one of its states. Choose a mounted instance, then click a declared render-state name. Auto restores application-controlled rendering. The panel indicates forced states and reports missing preview props. Overrides are temporary, are never saved to localStorage, and clear when the instance unmounts or the last connected inspector closes.

Previewing changes the rendered component, not application data, routing, or the conditions that normally select that state. Components still run their normal React lifecycle and effects. Unmounted layouts cannot be forced.

Use defineLayoutPreview from the main library for typed, partial state props:

import { defineLayoutPreview } from '@jfdevelops/react-layout';

const Page = definition.createResourceLayout({ name: 'UsersPage', resource: 'users' });

if (import.meta.env.DEV) {
  defineLayoutPreview(Page, {
    Empty: { message: 'No users found' },
    // Each entry is checked against that render state's component props.
  });
}

Compatible current props are reused; fixtures override them for the selected state. default supplies fixtures for the default render state. Namespace layouts ({ Root, Loading, ... }) are supported too. Guard fixtures with import.meta.env.DEV to avoid shipping sample data in production bundles.

Options

reactLayoutDevtools({
  production: false, // omit the inspector from production builds; defaults to false
  statePreview: false, // development source locations only; defaults to true
  imports: ['my-layout-wrapper'], // extra packages that re-export the layout API
  include: /\/src\//,
  exclude: /\.test\.[jt]sx?$/,
});

Relative imports and @/ aliases are recognized automatically. For other aliases, add the import specifier to imports. The plugin runs before React transforms, returns source maps, skips dependencies and SSR transforms, and does not instrument production builds. In production, it resolves the React inspector to empty components by default; set production: true to include the inspector instead. It uses Vite's development transform and editor integration; other bundler adapters can provide the same optional devtools-core metadata and preview capabilities.