Skip to content

Instantly share code, notes, and snippets.

@spaquet
Last active January 18, 2022 19:28
Show Gist options
  • Save spaquet/da43244dd777a6013f411caf24941926 to your computer and use it in GitHub Desktop.
Save spaquet/da43244dd777a6013f411caf24941926 to your computer and use it in GitHub Desktop.
Rails Popper Stimulus Index file
<section class="bg-gray-100 h-full w-full">
<div class="container mx-auto px-2 md:px-4 py-4">
<div class="flex justify-center items-center h-full md:h-screen">
<div class="flex flex-col p-5 border border-gray-500 bg-white shadow-xl rounded-xl w-96 h-96 items-center justify-center">
<h2>Button with popper</h2>
<div data-controller="popper">
<button id="button" data-popper-target="element" data-action="mouseenter->popper#show mouseleave->popper#hide" class="bg-blue-500 text-blue-100 px-3 py-2 rounded-xl">
Over me!
<div id="tooltip" role="tooltip" data-popper-target="tooltip">
My tooltip
<div id="arrow" data-popper-arrow></div>
</div>
</button>
</div>
</div>
</div>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment