1.1.0 • Published 1 year ago

native-popover v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

native-popover

No dependencies, basic vanilla js enhancement for browser popover API.

Installation

npm install native-popover --save

Configuration

Library provides additional features such as:

  • reacting to window resize
  • selecting popover placement
  • calculating position of popover in relation to trigger element placement

Except standard attributes from native API (such us popover), trigger element can accept data-position attribute. Available values: bottom, bottom-right, bottom-left, top, top-left, top-right, left, right.

Example

<body>
    <button popovertarget="mypopover">OPEN POPOVER</button>
    <div id="mypopover" popover data-position="bottom-right">
        POPOVER BODY
    </div>
</body>
import init as nativePopoverInit from "native-popover";
window.addEventListener("DOMContentLoaded", nativePopoverInit);
1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago