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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rikarin/preactor

v0.2.4

Published

Interop between preact and C#

Readme

Preactor

Unity Version License Documentation Discord

🚀 Overview

Preactor is a revolutionary toolkit that bridges the gap between modern web development and Unity game development, empowering you to create stunning, responsive user interfaces with unprecedented ease and flexibility.

By bringing Preact (a fast 3kB alternative to React) and Tailwind CSS (a utility-first CSS framework) into the Unity ecosystem, Preactor transforms how you approach UI development in your games and applications.

✨ Features

🧩 Modern Component-Based Architecture

  • Build reusable, modular UI components
  • Implement reactive interfaces that update automatically when data changes
  • Organize your UI code more logically and maintainably
  • Leverage the familiar JSX-like syntax that web developers love

🎨 Effortless Styling with Tailwind CSS

  • Access thousands of utility classes for instant styling
  • Maintain consistent design language across your entire project
  • Implement responsive designs that work across different screen sizes
  • Customize your UI without writing a single line of CSS

⚡ Streamlined Development Workflow

  • Hot reloading capabilities for instant feedback
  • TypeScript support for type safety and better tooling
  • Efficient compilation through esbuild
  • Seamless integration with Unity's existing systems

🔄 Unity Addressables Integration

  • Load UI components asynchronously for better performance
  • Update your UI without requiring a full app update
  • Optimize memory usage by loading only what you need
  • Implement dynamic content updates post-release

📋 Prerequisites

Before installing Preactor, ensure you have:

  • Unity 6000.0 or newer
  • Node.js 14+ and npm installed on your development machine
  • Basic familiarity with Unity's Package Manager
  • Git installed (for package installation)

🔧 Installation

1. Install Preactor via Unity's Package Manager

  1. Open Unity.

  2. Navigate to Window > Package Manager.

  3. Click the + button in the top-left corner and select Install package from Git URL....

  4. Enter the following Git URL:

    https://github.com/Rikarin/preactor.git?path=/Assets/Plugins/Preactor

2. Initialize the Preactor Directory

After installation, initialize the Preactor directory:

mkdir Preactor

3. Copy Solution Files

Copy the contents of the ./Preactor/solution directory from the Preactor Git repository into your <Project>/Preactor directory.

4. Compile JavaScript Views

Compile your JavaScript views with:

pnpm run start

5. Set Up Preactor in the Scene

  1. Create a global object: Preactor > Preactor Global
  2. Create a renderer object: Preactor > Preactor Renderer
  3. Import your compiled JavaScript view into the renderer object

💻 Usage Example

Here's a simple example of a button component in Preactor:

import Button from './Button';

function SaveButton() {
  return (
    <Button variant="default" color="green" onClick={() => saveData()}>
      Save
    </Button>
  );
}

// Different button variants
function ButtonVariants() {
  return (
    <div className="flex gap-4">
      <Button variant="default">Default</Button>
      <Button variant="small">Small</Button>
      <Button variant="icon">🔍</Button>
    </div>
  );
}

🌟 Benefits

For Game Developers

  • Reduced Development Time: Build complex UIs in a fraction of the time
  • Improved Iteration Speed: Make changes quickly and see results instantly
  • Better Collaboration: Allow web developers to contribute directly to your game UI
  • Future-Proof Skills: Use technologies that are widely adopted in the broader development community

For Studios

  • Consistent UI: Maintain design consistency across multiple projects
  • Easier Onboarding: Leverage widely-known web technologies to reduce training time
  • Flexible Updates: Push UI changes without requiring full app updates
  • Cross-Platform Excellence: Create responsive UIs that work beautifully across all platforms

📚 Documentation

For comprehensive documentation, visit our Documentation Website.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

🙏 Acknowledgements

  • OneJS - For the original idea of using Preact in Unity
  • Preact - For providing the lightweight React alternative
  • Tailwind CSS - For the utility-first CSS framework
  • esbuild - For the extremely fast JavaScript bundler
  • Unity - For the "amazing" game development platform