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"}) %>

In the same orbit

Explore more open source projects

Schedule call

Irina Nazarova CEO at Evil Martians

Evil Martians transform growth-stage startups into unicorns, build developer tools, and create open source products. Hire us to design and build your product