Skip to content

Colocated overlay drop menu that pops out of scroll ancestors and traps focus

Notifications You must be signed in to change notification settings

pinkhominid/pop-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pop Menu

Colocated overlay drop menu that pops out of scroll ancestors and traps focus.

Install

npm i @pinkhominid/pop-menu

Usage

<script type="module">
  import '@pinkhominid/pop-menu';
  document.querySelector('pop-menu').addEventListener('toggle', e => console.log(e.target.open));
</script>

<!-- justify=start|center|end -->
<pop-menu justify=start>
  <button slot=trigger>Pop</button>
  <ul slot=menu>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ul>
</pop-menu>

About

Colocated overlay drop menu that pops out of scroll ancestors and traps focus

Resources

Stars

Watchers

Forks

Packages

No packages published