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

@emptyui/float

v0.1.5

Published

A flexible component for creating your own floating elements in React Native.

Readme

@emptyui/float

A flexible Float component with pure layout measurement to create your own floating components Modal, Bottom Sheet, Dropdown, Tooltip in React Native.

Why?

Most React Native floating component libraries try to do everything, making it hard to customize animations, styles, or even just the backdrop. This library provides a simple Float component that handles positioning while giving you complete freedom over animations, styles.

Installation

npm install @emptyui/float
# or
yarn add @emptyui/float

Features

  • 🎯 Precise positioning with multiple alignment options
  • 🔄 Relative and root binding support
  • 🎭 Flexible enough to build various floating components
  • 📱 React Native, React Native Web
  • 🎨 Customizable backdrop and overlay

Usage

First, wrap your app with FloatProvider:

import { FloatProvider } from "@emptyui/float";

function App() {
  return <FloatProvider>{/* Your app content */}</FloatProvider>;
}

The Float component is a building block for creating various floating UI elements. Here are some examples:

Basic Modal

import { Float } from "@emptyui/float";
import { View, Text, TouchableOpacity } from "react-native";
import Animated, { FadeIn } from "react-native-reanimated";

function ModalExample() {
  const floatRef = useRef<Float>(null);

  return (
    <View>
      <TouchableOpacity onPress={() => floatRef.current?.show()}>
        <Text>Open Modal</Text>
      </TouchableOpacity>

      <Float
        ref={floatRef}
        align="center"
        // Your own Backdrop node
        backdrop={<Backdrop onPress={floatRef.current!.hide} />}
      >
        {/** Manage the animation yourself */}
        <Animated.View entering={FadeIn}>
          <Text>Modal Content</Text>
          <TouchableOpacity onPress={floatRef.current!.hide}>
            <Text>Close</Text>
          </TouchableOpacity>
        </Animated.View>
      </Float>
    </View>
  );
}

Bottom Sheet

import { Float } from "@emptyui/float";
import { View, Text, TouchableOpacity } from "react-native";
import Animated, { FadeInUp } from "react-native-reanimated";

function BottomSheetExample() {
  const floatRef = useRef<Float>(null);

  return (
    <View>
      <TouchableOpacity onPress={() => floatRef.current?.show()}>
        <Text>Open Bottom Sheet</Text>
      </TouchableOpacity>

      <Float
        ref={floatRef}
        align="bottom-stretch"
        // Your own Backdrop node
        backdrop={<Backdrop onPress={floatRef.current!.hide} />}
      >
        {/** Manage the animation yourself */}
        <Animated.View entering={FadeInUp}>
          <Text>Bottom Sheet Content</Text>
          <TouchableOpacity onPress={floatRef.current!.hide}>
            <Text>Close</Text>
          </TouchableOpacity>
        </Animated.View>
      </Float>
    </View>
  );
}

Dropdown Menu

import { Float } from "@emptyui/float";
import { View, Text, TouchableOpacity } from "react-native";

function DropdownExample() {
  const floatRef = useRef<Float>(null);
  const triggerRef = useRef(null);

  return (
    <View>
      <TouchableOpacity
        ref={triggerRef}
        onPress={() => floatRef.current?.toggle()}
      >
        <Text>Open Dropdown</Text>
      </TouchableOpacity>

      <Float
        ref={floatRef}
        binding="relative"
        bindingRef={triggerRef}
        align="bottom-left"
      >
        <View>
          <TouchableOpacity>
            <Text>Option 1</Text>
          </TouchableOpacity>
          <TouchableOpacity>
            <Text>Option 2</Text>
          </TouchableOpacity>
          <TouchableOpacity>
            <Text>Option 3</Text>
          </TouchableOpacity>
        </View>
      </Float>
    </View>
  );
}

Tooltip

import { Float } from "@emptyui/float";
import { View, Text, TouchableOpacity } from "react-native";

function TooltipExample() {
  const floatRef = useRef<Float>(null);
  const triggerRef = useRef(null);

  return (
    <View>
      <TouchableOpacity
        ref={triggerRef}
        onPress={() => floatRef.current?.toggle()}
      >
        <Text>Hover me</Text>
      </TouchableOpacity>

      <Float
        ref={floatRef}
        binding="relative"
        bindingRef={triggerRef}
        align="top-center"
      >
        <View>
          <Text style={{ color: "white" }}>Tooltip content</Text>
        </View>
      </Float>
    </View>
  );
}

Props

| Prop | Type | Default | Description | | ------------- | ---------------------- | ---------------------------------------- | ------------------------------------------- | | align | Align | 'center' | Alignment position for the floating element | | alignTarget | 'outer' \| 'inner' | 'outer' (relative) or 'inner' (root) | Target of the alignment | | binding | 'relative' \| 'root' | 'root' | Binding type for positioning | | bindingRef | RefObject<View> | - | Required for relative binding | | backdrop | ReactElement | null | Backdrop component | | overlay | ReactElement | null | Overlay component | | id | string | random | Unique identifier for the float |

Alignment Options

The align prop supports the following values:

  • center: Center of the screen
  • top-left, top-right, top-center, top-stretch
  • bottom-left, bottom-right, bottom-center, bottom-stretch
  • left-center, left-stretch
  • right-center, right-stretch

Methods

The Float component exposes the following methods through ref:

  • show(): Show the float
  • hide(): Hide the float
  • toggle(): Toggle the float visibility
  • visible: Boolean indicating if the float is visible