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

Overview

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.

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
You might also like...

Bootstrap 5 Floating Label

Bootstrap 5 Floating Label

@tkrotoff/bootstrap-floating-label Floating label for Bootstrap 5 Example: https://codesandbox.io/s/github/tkrotoff/bootstrap-floating-label/tree/code

Dec 10, 2022

Show floating sticky outline (table of contents) for Notion pages, powered by nbundle.

Notion Outline Show floating sticky outline (table of contents) for Notion pages, powered by nbundle. This is an nbundle-powered Notion app bootstrapp

Nov 10, 2022

A react and framer motion app to play some quizzes !

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: ya

Jan 7, 2022

My personal website built with Next.js, TypeScript, twin.macro, Framer Motion, MDX and deployed on Vercel.

chrvaskos.com My personal website / blog built with some of my favorite technologies where I can showcase my work and write articles about anything ne

Mar 25, 2022

Portfólio de projetos pessoais feito com NextJs e lib de animação Framer Motion

Portfólio de projetos pessoais feito com NextJs e lib de animação Framer Motion

Portfólio - Carlos Amorim Esse portfólio foi criado para mostrar meus projetos e habilidades. 🚀 Projeto criado com as seguintes tecnologias: ✔️ NextJ

May 12, 2022

Careers page made with Next.js, Framer Motion & Tailwind CSS

Careers page made with Next.js, Framer Motion & Tailwind CSS

Careers Page Tech Stack: Next.js / Framer Motion / Tailwind CSS This is a Next.js project bootstrapped with create-next-app. Getting Started First, ru

Nov 16, 2022

Under the Sea is an official AWS workshop delivered by AWS SAs and AWS Partners to help customers and partners to learn about AIOps with serverless architectures on AWS.

Under the Sea - AIOps with Serverless Workshop Under the Sea is an exciting MMORPG developed by the famous entrepreneur behind Wild Rydes, the most po

Nov 16, 2022

Receive confessions and messages anonymously! (Under development)

About ⚠️ This project is under heavy development! ⚠️ umamin is an ad-free and open-source platform for sending and receiving anonymous confessions! Ea

Dec 11, 2022

convert markdown to html in under 5kb

convert markdown to html in under 5kb

convert markdown to HTML in under 5kb take a look at the to PHP translated version: https://github.com/SimonWaldherr/micromarkdown.php about License:

Dec 8, 2022
Reddit Page CLONE using Angular! A repository to contribute at hacktoberfest 2022. Make sure to share love by giving it a star.🌟 Have a great day!

Reddit_tool Reddit Site CLONE using Angular, Springboot and Swagger OpenAI ! Introduction This project was developed with the following technologies:

Momo-Solaris8 4 Oct 20, 2022
IndexedDB with usability and remote syncing

IndexedDB with usability and remote syncing This is a fork of the awesome idb library, which adds the ability to sync an IndexedDB database with a rem

Damien Arrachequesne 8 Dec 14, 2022
Chrome extension to simulate cryptoblades fights, giving you the win rate % against all enemies with just one click

CryptoBlades fight simulator This is a Chrome extension that will help you to know the exact win rate percentage you have on each cryptoblades fight.

Jose Leonardo Dos Ramos Rivas 12 Aug 7, 2022
A JavaScript animation plugin for menus. It creates a div that moves when you mouse over an element, giving it an elastic animation.

Lava-Lamp Description: A JavaScript animation plugin for menus. It creates a div that moves when you mouse over an element, giving it an elastic anima

Richard Hung 38 Jun 4, 2022
Quick and easy spring animation. Works with other animation libraries (gsap, animejs, framer motion, motion one, @okikio/animate, etc...) or the Web Animation API (WAAPI).

spring-easing NPM | Github | Docs | Licence Quick and easy spring animations. Works with other animation libraries (gsap, animejs, @okikio/animate, mo

Okiki Ojo 34 Dec 14, 2022
Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Node IPC 43 Dec 9, 2022
Displaying actual age in percentage with 9 signs after dot (floating number)

Actual Age Chrome Extension Displaying actual age in percentage with 9 signs after dot (floating number) Features Popup You can select your Birth date

Igor Makeenko 22 Nov 2, 2022
Input with floating label make with tailwindcss 3.0.18

tailwind-floating-label-input Input with floating label make with tailwindcss 3.0.18 Works with <input> and <textarea> elements. How to use <Input

Pablo David Gago Ballester 1 Feb 10, 2022
Svelte✨ Floating UI 🎈

?? Svelte Floating UI Floating UI for Svelte with actions. No wrapper components or component bindings required! npm i -D svelte-floating-ui Usage cre

Nikita Fedorov 39 Dec 24, 2022
Unread-Messages.js is a lightweight library that lets a user add floating number notifications to any object.

Unread-Messages.js About Unread-Messages.js is a lightweight library that lets a user add mobile-like notification counter badge to any object with ju

Mulaza Jacinto 2 Dec 18, 2021