1.0.2 • Published 4 years ago

rn-expandable-circle-menu v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

React Native Expandable Circle Menu

React Native expandable circle menu library

Demo

Installation

First, download the library from npm:

npm install rn-expandable-circle-menu --save

Usage

import CircleMenu from 'rn-expandable-circle-menu'

const openMenuButton = {
  image: require('./assets/openMenu.png'),
}

const closeMenuButton = {
  image: require('./assets/closeMenu.png'),
  // You can override style of every item
  style: {
    backgroundColor: 'red'
  }
}

const menuItems = [
  {
    image: require('./assets/shareLogo.png'),
    onClick: () => {
      alert('Share button pressed')
    },
    style: {
      backgroundColor: 'yellow'
    }
  },
  {
    image: require('./assets/searchLogo.png'),
    onClick: () => {
      alert('Search button pressed')
    }
  },
  {
    image: require('./assets/moreLogo.png'),
    onClick: () => {
      alert('More button pressed')
    }
  },
  {
    image: require('./assets/downloadLogo.png'),
    onClick: () => {
      alert('Download button pressed')
    }
  },
];


const CircleMenuView = () => {
  return (
    <CircleMenu
      menuItems={menuItems}
      openMenuButton={openMenuButton}
      closeMenuButton={closeMenuButton}
    />
  )
}

Props

NameDescriptionTypeRequired
menuItemsArray of menu itemsArrayYES
openMenuButtonObject for open menu buttonObjectYES
closeMenuButtonObject for close menu buttonObjectYES

menuItems

NameDescriptionTypeRequired
imageThe icon of the itemImageYES
onClickThe function that called when pressed on menu itemFunctionYES
styleStyle object to override styleObjectNO

openMenuButton & closeMenuButton

NameDescriptionTypeRequired
imageThe icon of the itemImageYES
styleStyle object to override styleObjectNO