TurboMount

Add the turbo-mount gem to your Gemfile:

gem 'turbo-mount'

If your project uses build tools like Vite, also install the turbo-mount npm package:

yarn add turbo-mount

Import the necessary modules and initialize TurboMount with your application and the desired plugin:

import { Application } from "@hotwired/stimulus";
import { TurboMount } from "turbo-mount";
import plugin from "turbo-mount/react";
import { SketchPicker } from 'react-color';

const application = Application.start();
const turboMount = new TurboMount({ application, plugin });
turboMount.register('SketchPicker', SketchPicker);

And finally, add the component to your view:

<%= turbo_mount_react_component("SketchPicker", props: {color: "#430"}) %>
Author

In the same orbit

Explore more open source projects

Let's solve your hard problems

Martians at a glance
18
years in business

We're experts at helping developer products grow, with a proven track record in UI design, product iterations, cost-effective scaling, and much more. We'll lay out a strategy before our engineers and designers leap into action.

If you prefer email, write to us at surrender@evilmartians.com