The short-form tutorial below represents how to pair Rails UI, Stimulus.js, and Tippy.js together.
1. Initializing the Stimulus.js controller
Leverage the Railsui Tooltip Stimulus controller from railsui-stimulus for drop-in tooltips.
2. Initialize the controller in your views
Add the data attribute data-controller='railsui-tooltip' to an HTML element.
3. Pass content to the tooltip
Add the data attribute data-tooltip-content-value='Your content here' to an HTML element. Inside the data attribute you may pass as much copy as you like.
(optional) 4. Allow HTML in content
Add the data attribute data-tooltip-allow-html-value="true" to an HTML element. Inside the data attribute pass true to enable the option allowHTML for the tippy.js library.