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

ripple-react-wrapper

v0.1.0

Published

Basic ripple react component wrapper

Readme

Ripple React Wrapper

A lightweight wrapper component that enables seamless integration of React components within the Ripple framework.

Overview

The Ripple React Wrapper allows you to embed existing React components into Ripple applications, providing a bridge between the two frameworks. This is particularly useful when migrating from React to Ripple or when you want to reuse existing React components in a Ripple project.

Features

  • 🔄 Seamless Integration: Embed React components directly in Ripple
  • 🎯 Type Safety: Full TypeScript support with proper type definitions
  • 🚀 Performance: Efficient mounting and unmounting of React components
  • 📦 Lightweight: Minimal overhead with clean API
  • 🔧 Flexible: Pass props and HTML attributes easily

Installation

npm install ripple-react-wrapper
# or
pnpm add ripple-react-wrapper
# or
yarn add ripple-react-wrapper

Requirements

  • Node.js >= 20.0.0
  • React >= 18.2.0
  • Ripple >= 0.2.35

Usage

Basic Example

import { ReactWrapper } from 'ripple-react-wrapper';
import MyReactComponent from './MyReactComponent';

export component MyRippleComponent() {
  <ReactWrapper 
    component={MyReactComponent} 
    $props={{ title: "Hello from Ripple!" }}
    class="my-wrapper"
  />
}

React Component Setup

Important: React components used with this wrapper must include the following import at the top:

import * as React from 'react';

Example React component:

import * as React from 'react'; // Required!
import { useState } from 'react';

interface MyComponentProps {
  title?: string;
  initialCount?: number;
}

export default function MyComponent({ title = "Counter", initialCount = 0 }: MyComponentProps) {
  const [count, setCount] = useState(initialCount);

  return (
    <div>
      <h2>{title}</h2>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>
        Increment
      </button>
    </div>
  );
}

Advanced Usage

import { ReactWrapper } from 'ripple-react-wrapper';
import ComplexComponent from './ComplexComponent';

export component AdvancedExample() {
  let componentProps = {
    data: [1, 2, 3, 4, 5],
    onItemClick: (item) => console.log('Clicked:', item),
    theme: 'dark'
  };

  <ReactWrapper 
    component={ComplexComponent}
    $props={componentProps}
    style="border: 1px solid #ccc; padding: 16px;"
    data-testid="react-wrapper"
  />
}

API Reference

ReactWrapper Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | component | ComponentType<any> | ✅ | The React component to render | | $props | Record<string, any> | ❌ | Props to pass to the React component | | ...otherProps | any | ❌ | Additional HTML attributes for the wrapper div |

Types

interface ReactWrapperProps {
  component: ComponentType<any>;
  $props?: Record<string, any>;
  [key: string]: any;
}

type WrappableReactComponent<P = {}> = ComponentType<P>;
type ComponentProps<T> = T extends ComponentType<infer P> ? P : never;

How It Works

The wrapper creates a div element and uses React's createRoot API to mount your React component inside it. The component is properly unmounted when the Ripple component is destroyed, ensuring no memory leaks.

  1. Mount: When the wrapper mounts, it creates a React root and renders your component
  2. Props: Component props are passed through the $props attribute
  3. Cleanup: When unmounting, the React root is properly cleaned up

Known Issues

  • React components must include import * as React from 'react'; at the top
  • TypeScript may show warnings for .ripple files (this is expected and being worked on)

Development

# Format code
npm run format

# Check formatting
npm run format:check

License

MIT

Contributing

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