react-overflow-menu
React component for overflow menu styled in bootstrap
Example
<!-- Put bootstrap cdn link (like below) in index.html of your React App --><!-- Latest compiled and minified CSS -->
import React Component from 'react';import OverflowMenu from 'react-overflow-menu'; // Mention your own menu items (only 'id' and 'text' are supported)const menuItems = id: 'edit' text: 'Edit' id: 'delete' text: 'Delete' ; console; // Write your own logic { return <div> OverflowMenu <br /> <div ="container"> <table => <tr> <td>Demo</td> </tr> <tr> <td> <OverflowMenu ="text-right" = = /> </td> </tr> </table> </div> </div> ; } ;
Install
npm install react-overflow-menu
Props
className
Sets the class name (bootstrap class) of the overflow menu. Defaults to text-right
. Valid values are:
text-left | text-center | text-right
:: Alignment of the overflow menu
menuItems
An array of object with properties like 'id' and 'text'.
const menuItems = id: 'edit' text: 'Edit' id: 'delete' text: 'Delete' ;
menuItemClick
A callback function to get event object of a button of a menu item.
License
MIT