Socket
Socket
Sign inDemoInstall

react-floting-button

Package Overview
Dependencies
22
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-floting-button

Simple floating button component for react-native


Version published
Weekly downloads
7
increased by250%
Maintainers
1
Install size
7.46 MB
Created
Weekly downloads
 

Readme

Source

react-floting-button

Floating button for React Native

Installation

yarn add react-floting-button

Or

npm install react-floting-button

How to use it

first step: import the component: import {FloatingButton} from "react-floting-button"

Second step: define the buttons

const actions = [
  {
    text: "Reload",
    icon: "reload",
    link: 'callback',
    size:20,
    color:'#555',
    position: 1,
  },
  {
    text: "Order",
    icon: "food-fork-drink",
    link: "foofScreen",
    size:20,
    color:'#555',
    position: 2
  },
]

Third step: use it

<FloatingButton
          actions={actions}
          text="$17.00"
          title="pay"
          navigation={navigation}
/>

Example of how Expo looks

Example of how Expo looks

EXemple

import {FloatingButton} from "react-floting-button" ;
const actions = [
  {
    text: "Reload",
    icon: "reload",
    link: 'callback',
    size:20,
    color:'#555',
    position: 1,
  },
  {
    text: "Order",
    icon: "food-fork-drink",
    link: "foofScreen",
    size:20,
    color:'#555',
    position: 2
  },
]


export default class  App extends Component {
	constructor(props){
		super(props)
	}
  render(){
  const {navigation} = this.props ;
    return (
      <View style={styles.container}>

        <View style={{flex:1,justifyContent:"center",alignItems:"center"}}>
          <Text>Ici button exemple</Text>
        </View>

        <FloatingButton
          actions={actions}
          text="$17.00"
          title="pay"
          navigation={navigation}
        />
      </View>
    ) ;
}

Configuration

FloatingButton

PropertyTypeDefaultDescription
actionsarray[]Actions to be show once user press the main button
colorstring#FFFColor of the main button
backgroundColorstring#00B15Ebackground color of the main button
AnimatedbackgroundColorstringrgba(0,0,0,.2)background color of view animated
textstringTitle of main button is Required
titlestringlabel of main button when is clicked is Required
navigationobjectnavigation props is Required when you are linked button to another screen

Actions

PropertyTypeDefaultDescription
textstringText to show near to the button.
iconstringIcon to be rendered inside the action, we accept the name of icon refer to **'react-native-vector-icons/MaterialCommunityIcons' **
linkstringthe screen name where you want to go once the button click (route name)
sizenumbersize of Icon
colorstringColor of the Icon button
positionstringelement positioning, at which position to display each button first, second or ..

Keywords

FAQs

Last updated on 11 Apr 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