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

ui-render

v0.1.0

Published

Django-style render() for React : render(componentPath, props)

Readme

ui-render

Django-style render() for React & Vite Render components by path or name with props — no need for manual imports.

✨ Features

🎯 Render components dynamically with render(componentName, props)

⚡ Zero-config with Vite (import.meta.glob)

📦 Lightweight — no runtime overhead

🛠 Supports nested directories (shared/UserInfoCard)

✅ Works in both dev and production builds

📦 Installation npm install ui-render

This package requires React 18+ and Vite.

⚡ Quick Start Example

Create a Vite + React project

npm create vite@latest my-app -- --template react-ts
cd my-app
npm install

Install ui-render

npm install ui-render

-> Add lib/ui.ts

// src/lib/ui.ts
import { createRenderer } from "ui-render";

export const render = createRenderer({
  baseDir: "src/components", 
  viteModules: import.meta.glob("/src/components/**/*.tsx"),
});

-> Create components


// src/components/Hero.tsx
export default function Hero({ title }: { title: string }) {
  return <h1 className="text-3xl font-bold">{title}</h1>;
}

// src/components/About.tsx
export default function About() {
  return <p className="text-gray-600">This is the about section.</p>;
}

// src/components/shared/UserInfoCard.tsx
export default function UserInfoCard({ name, email }: { name: string; email: string }) {
  return (
    <div className="border rounded p-4">
      <h2 className="font-semibold">{name}</h2>
      <p>{email}</p>
    </div>
  );
}


// Use in App.tsx

// src/App.tsx
import { render } from "@/lib/ui";

function App() {
  return (
    <div className="flex flex-col gap-4 p-6">
      {render("Hero", { title: "Hello World!" })}
      {render("About")}
      {render("shared/UserInfoCard", {
        name: "John Doe",
        email: "[email protected]",
      })}
    </div>
  );
}

export default App;

Run the app

npm run dev

Open http://localhost:5173 🚀

⚙️ API

createRenderer(options)

| Option | Type | Required | Description | | ------------ | ------------------------------------ | -------- | ---------------------------------- | | baseDir | string | ✅ | Root directory for components | | viteModules| Record<string, () => Promise<any>> | ✅ | Import map from import.meta.glob |

Returns a render function:

render(componentName: string, props?: Record<string, any>): ReactNode

📁 File Naming Conventions

| File Location | Render Key | | ------------------------------------- | ----------------------- | | src/components/Hero.tsx | "Hero" | | src/components/About.tsx | "About" | | src/components/shared/UserInfoCard.tsx | "shared/UserInfoCard" |

⚠️ Important Warning

Do not render a component inside itself using the render() function.
For example, avoid doing this inside Home.tsx:

function Home() {
  return (
    <div>
      {render("Home")} {/* ❌ This will cause infinite recursion */}
    </div>
  );
}

🛠 Next Version goals

  • Manifest support (non-Vite projects)

  • Next.js RSC support

  • Custom error fallback option