Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How To Have Fixed Side Popup

Im trying to figure out how to create a side popup/banner similar to the popup that appears when right clicking and pressing search on a mac.

enter image description here

Im not really sure what to search or how to start, could someone show me what to do and push me in the right direction (preferably using tailwind but i can adapt)? Thanks in advance.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

it’s called popovers, you can search any tailwind element or components site you’ll find a lot

  1. https://tailwind-elements.com/docs/standard/components/popover/
  2. https://tailwinduikit.com/components/webapp/UI_element/popover
  3. more in https://www.google.com/search?q=make+popovers+in+tailwind

note: the code snippet have problems on cdn tailwind, it works on normal tailwind CLI one

var popoverTriggerList = [].slice.call(
  document.querySelectorAll('[data-bs-toggle="popover"]')
);
var popoverList = popoverTriggerList.map(function(popoverTriggerEl) {
  return new Popover(popoverTriggerEl);
});
<script src="https://cdn.tailwindcss.com"></script>
<div class="flex justify-center flex-wrap">
  <button type="button" class="
          px-7
          py-3
          bg-red-600
          text-white
          font-medium
          text-sm
          leading-snug
          uppercase
          rounded
          shadow-md
          hover:bg-red-700 hover:shadow-lg
          focus:bg-red-700 focus:shadow-lg focus:outline-none focus:ring-0
          active:bg-red-800 active:shadow-lg
          transition
          duration-150
          ease-in-out
        " data-bs-toggle="popover" data-bs-title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">
    Click to toggle popover
  </button>
</div>
<!-- Required popper.js -->
<script src="https://unpkg.com/@popperjs/core@2.9.1/dist/umd/popper.min.js" charset="utf-8"></script>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading