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

@joemasilotti/bridge-components

v0.12.2

Published

A collection of bridge components for Hotwire Native apps (Stimulus controllers).

Readme

Bridge Components for Hotwire Native apps

by Joe Masilotti, the Hotwire Native guy

Hotwire Native enables seamless communication between native Swift and Kotlin code and web views in hybrid mobile apps. Bridge components extend this functionality by providing reusable native components that interact your web views. They enable developers to break out of the web view container and drive native features.

This repository contains generalized, production-ready bridge components extracted from real-world client projects. Once installed, each component can be added to any page of your app and customized with a bit of HTML.

Bridge component examples

Components

See all the components

Requirements

Check the examples/ directory for demo iOS, Android, and Rails apps.

Installation

Each component requires a Stimulus controller and a Swift/Kotlin component.

Web - Stimulus controllers

1. Install the bridge-components package

Add the bridge-components module via yarn:

yarn add @joemasilotti/bridge-components

or npm:

npm install @joemasilotti/bridge-components

or with Rails importmaps:

bin/importmap pin @joemasilotti/bridge-components

2. Register the Stimulus controllers

Register the Stimulus controllers after starting your Stimulus application:

import { Application } from "@hotwired/stimulus"
import { controllers } from "@joemasilotti/bridge-components"

const application = Application.start()
application.load(controllers)

iOS - Swift components

1. Add the Swift package dependency

In Xcode, select File → Add Packages Dependencies… and enter https://github.com/joemasilotti/bridge-components in the search field. Make sure your project is set under "Add to Project" and click Add Package. Then click Add Package again.

2. Register the native components

Import the framework and register all the available components in AppDelegate.swift:

import BridgeComponents // THIS LINE
import HotwireNative
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Hotwire.registerBridgeComponents(Bridgework.coreComponents) // THIS LINE
        return true
    }
}

Android - Kotlin components

1. Add the JitPack repository to your build file

In Android Studio, add the following line to settings.gradle.kts:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") } // THIS LINE
    }
}

2. Add the dependency

Add the following line to the bottom of build.gradle.kts (Module :app), replacing <latest-version> with the latest release:

dependencies {
    // ...

    implementation("dev.hotwire:core:<hotwire-native-version>")
    implementation("dev.hotwire:navigation-fragments:<hotwire-native-version>")

    implementation("com.github.joemasilotti:bridge-components:<latest-verison>") // THIS LINE
}

3. Register the native components

In your Application() subclass add the following:

package com.your.package.name

import android.app.Application
import com.masilotti.bridgecomponents.shared.Bridgework // THIS LINE
import dev.hotwire.core.bridge.KotlinXJsonConverter // THIS LINE
import dev.hotwire.core.config.Hotwire
import dev.hotwire.navigation.config.registerBridgeComponents // THIS LINE

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        Hotwire.config.jsonConverter = KotlinXJsonConverter() // THIS LINE
        Hotwire.registerBridgeComponents(*Bridgework.coreComponents) // THIS LINE
    }
}

Usage

Once installed, use a component by adding a data-controller attribute that matches the name of the Stimulus controller.

For example, to use the Button Component:

<a href="#" data-controller="bridge--button">Button</a>

Each component can then be configured further. Check the docs/components/ directory for more information.

JavaScript events

A few controllers fire custom JavaScript events prefixed with the bridge-- namespace. You can listen for these to perform custom handling when:

Need help?

If you need help installing, configuring, or using the components, feel free to open a new discussion or send me an email. I'd love to help!