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.
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.
>Solution :
it’s called popovers, you can search any tailwind element or components site you’ll find a lot
- https://tailwind-elements.com/docs/standard/components/popover/
- https://tailwinduikit.com/components/webapp/UI_element/popover
- 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>
