Socket
Socket
Sign inDemoInstall

react-native-circle-floatmenu

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-circle-floatmenu

Path-esque circular action menu inspired by react-native-circular-action-menu.


Version published
Weekly downloads
27
increased by35%
Maintainers
1
Install size
163 kB
Created
Weekly downloads
 

Readme

Source

react-native-circular-action-menu

Geremih´s Path-esque circular action menu inspired by CircularFloatingActionMenu modified and tested on RN_0.63 by Kur.

react-native-circular-action-menu demo

Installation

npm i react-native-circle-floatmenu --save

Usage

First, require it from your app's JavaScript files with:

import CircleButton from 'react-native-circle-floatmenu';

CircleButton

CircleButton component is the main component which wraps everything and provides a couple of props (see Config below).

CircleButton.Item

CircleButton.Item specifies an Circle Button. You have to include at least 1 CircleButton.Item.

Example

The following Basic example can be found in example/Basic.

import React from 'react';
import {
  StyleSheet,
  View,
} from 'react-native';

import CircleButton from "react-native-circle-floatmenu";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";

const App = () => {
  return (
    <View style={styles.btn_container}>
          <CircleButton buttonColor="rgba(0,0,0,1)" position="topleft">
            <CircleButton.Item
              position="absolute"
              buttonColor="#000"
              title="Perfil"
              onPress={() => console.log("BtnPress")}
            >
              <Icon
                name="card-account-details"
                style={styles.circleButtonIcon}
              />
            </CircleButton.Item>
            <CircleButton.Item
              position="absolute"
              buttonColor="#000"
              title="Perfil"
              onPress={() => console.log("BtnPress")}
            >
              <Icon name="bookmark-outline" style={styles.circleButtonIcon} />
            </CircleButton.Item>
            <CircleButton.Item
              position="absolute"
              buttonColor="#000"
              title="Perfil"
              onPress={() => console.log("BtnPress")}
            >
              <Icon
                name="briefcase-outline"
                style={styles.circleButtonIcon}
              />
            </CircleButton.Item>
            <CircleButton.Item
              position="absolute"
              buttonColor="#000"
              title="Perfil"
              onPress={() => console.log("BtnPress")}
            >
              <Icon
                name="reply"
                style={styles.circleButtonIcon}
              />
            </CircleButton.Item>
            <CircleButton.Item
              position="absolute"
              buttonColor="#000"
              title="Perfil"
              onPress={() => console.log("BtnPress")}
            >
              <Icon
                name="power-standby"
                style={styles.circleButtonIcon}
              />
            </CircleButton.Item>
          </CircleButton>
    </View>
  );
};

const styles = StyleSheet.create({
  btn_container: {
    flex: 1,
    backgroundColor: "#59a6eb",
    justifyContent: "center",
    width: "100%",
    elevation: 8,
    borderRadius: 5,
    margin: 1,
  },
  circleButtonIcon: {
    fontSize: 20,
    height: 22,
    color: "white",
  },
});

export default App;

This will create a floating Button in the upper left corner with 5 action buttons. Also this example uses react-native-vector-icons for the button Icons.

FAB Example

<CircleButton
  buttonColor="rgba(231,76,60,1)"
  onPress={() => {
    console.log("hi");
  }}
/>

Configuration

CircleButton
PropertyTypeDefaultDescription
activebooleanfalseaction buttons visible or not
autoInactivebooleantrueAuto hide ActionButtons when ActionButton.Item is pressed.
positionstring"center"one of: left center right topleft topcenter and topright
radiusnumber100radius of menu
bgColorstring"transparent"color of overlay when ActionButtons are visible
buttonColorstring"rgba(0,0,0,1)"background color of the +Button (must be rgba value!)
btnOutRangestringprops.buttonColorbutton background color to animate to
outRangeScalenumber1changes size of button during animation
onPressfunctionnullfires, when ActionButton is tapped
onLongPressfunctionnullfires, when ActionButton is long pressed
onOverlayPressfunctionnullfires, when Overlay is pressed
iconComponent+Custom component for ActionButton Icon
backdropComponentfalseCustom component for use as Backdrop (i.e. BlurView, VibrancyView)
degreesnumber135degrees to rotate icon
CircleButton.Item
PropertyTypeDefaultDescription
onPressfuncnullrequired function, triggers when a button is tapped
buttonColorstringsame as + buttonbackground color of the Button
startDegreenumber0degrees to start the rotation of the Item
endDegreenumber720degrees to end the rotation of the Item

Keywords

FAQs

Last updated on 26 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc