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

@bayudev/react-native-floating-button

v0.0.3

Published

**A component Floating Button built with Reanimated v3+ and React Native Gesture handler V2+**

Downloads

38

Readme

REACT NATIVE FLOATING BUTTON

A component Floating Button built with Reanimated v3+ and React Native Gesture handler V2+

Getting Started

To use the FloatingButton component, you first need to install the package via npm or yarn. Run either of the following commands:

npm install @bayudev/react-native-floating-button
yarn add @bayudev/react-native-floating-button

🚨 🚨 Please note that this library is built with React Native Reanimated v3 and uses React Native Gesture Handler. If you haven't installed Reanimated and Gesture Handler yet, please follow the installation instructions for Reanimated and Gesture Handler.

Usage

First, import the FloatingButton component from the @bayudev/react-native-floating-button library:

import { FloatingButton } from '@bayudev/react-native-floating-button';
import { StatusBar } from "expo-status-bar";
import { Image, Pressable, StyleSheet, Text, View } from "react-native";
import { useEffect, useRef, useState } from "react";

// import here
import {
  FloatingButton,
  FloatingButtonMethods,
} from "@bayudev/react-native-floating-button";

import { GestureHandlerRootView } from "react-native-gesture-handler";

export default function App() {

  // add ref to call methods [show or hide]
  const floatingButtonRef = useRef<FloatingButtonMethods>(null);

  useEffect(() => {
    setTimeout(() => {
      floatingButtonRef.current?.show();
    }, 1000);
  }, []);

  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <View>
        <StatusBar style="auto" />
        
        <FloatingButton
          ref={floatingButtonRef}
          borderRadiusContent={50}
          heightContent={90}
          widthContent={90}
          maxLeft={10}
          maxRight={300}
          maxHeight={150}
          minHeight={80}
        >
          <View
            style={{
              width: 85,
              height: 85,
              borderRadius: 2,
              borderWidth: 1,
              borderColor: "#dedede",
              alignItems: "center",
              justifyContent: "center",
            }}
          >
            <View>
              <Pressable
                style={{
                  alignItems: "center",
                  justifyContent: "center",
                  width: 25,
                  height: 25,
                  position: "absolute",
                  zIndex: 99,
                  top: -10,
                  right: 0,
                  borderWidth: 2,
                  borderColor: "blue",
                  borderRadius: 50,
                }}
                onPress={() => {
                  floatingButtonRef.current?.hide();

                  setTimeout(() => {
                    floatingButtonRef.current?.show();
                  }, 3000);
                }}
              >
                <Text>X</Text>
              </Pressable>
              <Image
                source={require("./assets/giftbox2.gif")}
                style={{
                  width: 80,
                  height: 80,
                }}
              />
            </View>
          </View>
        </FloatingButton>
      </View>
    </GestureHandlerRootView>
  );
}

Properties

| Property | Type | Default | Required | Description | | -------------------- | ----------- | --------------------- | -------- | -------------------------------------------------------------------------------------| | ref | String | null | true | using useRef for manage BottomSheet component for show or hide | | widthContent | Number | 100 | true | width of FloatingButton | | heightContent | Number | 100 | true | height of FloatingButton | | borderRadiusContent | Number | 50 | false | border radius of FloatingButton | | maxLeft | Number | 10 | false | maximum left content of FloatingButton | | maxRight | Number | width screen - (width screen / 2.8) | false | maximum right content of FloatingButton | | minHeight | Number | width screen / 2.8 | false | minimum height content of FloatingButton | | maxHeight | Number | 50 | false | maximum height content of FloatingButton | | children | ReactNode | null or undefined | true | Put your any component here |

Author

License

The library is licensed under the MIT License.