npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

svelte-easy-popover

v1.0.0

Published

An easy-to-use popover component for Svelte 3 with out-of-the-box functionality.

Downloads

1,280

Readme

Introduction

An easy-to-use popover component for Svelte 3 with out-of-the-box functionality.

View the Docs and detailed usage.

This component is very flexible, while providing a lot of out-of-the-box functionality:

  1. Built in click, hover, and focus events to trigger showing the popover
  2. Simple, slot-driven design of the popover. No need to call special Javascript functions. Allows you to add your own transitions and styling to the popover within the normal style-block and transition directive.
  3. Flexible. The isOpen parameter lets you build the interaction exactly how you'd wish
  4. Extensible. This component uses Popper underneath, and exposes the popperOptions to you.

Install

npm install svelte-easy-popover

Usage

This is an example of an easy popover with a transition, placed above the button, spaced 10px away.

<script>
    import Popover from 'svelte-easy-popover';

    let referenceElement;
</script>

<button bind:this={referenceElement}>Open popover</button>
<Popover
  triggerEvents={["hover", "focus"]}
  {referenceElement}
  placement="top"
  spaceAway={10}
>
    <div
        class="popover-contents"
        transition:fade={{ duration: 250 }}
    >
        I'm a popover!
    </div>
</Popover>

<style>
    .popover-contents {
        border: 1px solid black;
        border-radius: 4px;
        padding: 8px;
    }
</style>

View the argument documentation to view more detailed information on how to use the component, or view the examples for different ways to use it.

Popper

Underneath, this component is using Popper. Please read their documentation for more details, but in general you shouldn't require knowing anything about Popper to get started.

Listening for state changes

If you use the triggerEvents property, it's not always obvious when the popover is open or closed. If you need to modify other state when opened or closed, you can freely use the on:change event, which is dispatched. It provides a simple way to keep track of the actual popover state if so desired.

    import Popover from 'svelte-easy-popover';

    let referenceElement;
    let isPopoverOpen;
</script>

<button bind:this={referenceElement}>Popover is {isPopoverOpen ? "Opened" : "Closed"}</button>
<Popover
  triggerEvents={["hover", "focus"]}
  {referenceElement}
  placement="top"
  spaceAway={10}
  on:change={({ detail: { isOpen }}) => isPopoverOpen = isOpen}
>
    <div transition:fade={{ duration: 250 }}>
        I'm a popover!
    </div>
</Popover>

Development

This project is easy to get running locally. For development, it is using the Svelte Storybook integration. Read more here.

  1. Install dependencies
npm install
  1. Launch Storybook. By default it lauches at http://localhost:6006
npm run storybook