data-popover
v0.3.2
Published
A simple wrapper around the native Popover API
Readme
data-popover
A lightweight wrapper around the native Popover API.
- No dependencies
- Declarative configuration via HTML attributes
- Pairs well with HTMx
Check out the docs & demo.
Installation
Download the minified version from the ./dist folder or use a CDN:
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/data-popover/dist/data-popover.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/data-popover/dist/data-popover.min.js"></script>Usage
- Add a
data-popoverattribute to a trigger element. - Place a popover element with the native
popoverattribute immediately after the trigger.
<button data-popover>Click me</button>
<div popover>Popover content</div>