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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-useoverlay

v0.7.0

Published

for creating floating components easily

Downloads

36

Readme

Create floating things easily

useOverlay uses floating-ui and framer-moting under the hood, giving you an API that provides great usability.

Warning Documentation is not complete! useOverlay is a very fresh hook. API can be changed.

Note You should know! For styling useOverlay doesn't do anything than passing className parameter to floating overlay for now. You can use Tailwind or some other solutions.

npm install react-useoverlay

Why Floating UI?

Floating UI is a tiny, low-level library for creating "floating" elements. The library provides two key functionalities:

1. Anchored positioning primitives

CSS is currently missing a feature called “anchored positioning” — the ability to anchor an element (like a tooltip) to another one (like a button) while simultaneously keeping it in view as best as possible by avoiding clipping and overflow. Attempting to do fully dynamic anchored positioning with today’s plain CSS is not possible. Floating UI provides a JavaScript implementation of this feature.

2. User interaction primitives

When creating a popover, dropdown menu, select, or combobox component that follows WAI-ARIA authoring practices, the complexity increases dramatically. Focus traps, indexed navigation, and typeahead are difficult to get right. This functionality is currently available for React DOM but will be made agnostic in the future.


Why framer-motion?

1. Production-ready motion library for React

Utilize the power behind Framer, the best prototyping tool for teams. Proudly open source.

2. Simple declarative syntax means you write less code

Less code means your codebase is easier to read and maintain. Animations that work like magic. When animating between two separate components, Framer Motion will take care of everything in between.


Why useOverlay?

1. Because it simplifies the API you need to deal with it.

That's it.

{% callout title="You should know!" %} For styling useOverlay doesn't do anything than passing className parameter to floating overlay for now. It's acting like headless. You can use Tailwind or some other solutions for syling. Depends on you! {% /callout %}

Use cases

  • If you don't wanna handle all the logic of floating elements
  • If you are building your own UI Library
  • If you wanna create a custom build floating overlays