dropdown-react-component

0.0.9 • Public • Published

React dropdown

react dropdown component

Installation

npm install dropdown-react-component

Usage

import DropDownButton from 'dropdown-react-component/dist/App'
import upArrowImg from 'path/to/asset'
import downArrowImg from 'path/to/asset'

const defaultOption = {
        icon: icon, 
        text: 'Main Option', 
        name: 'main option', 
        link: 'main link'
}

const options = [
    {
        icon: icon_1, 
        text: 'Option One', 
        name: 'option one', 
        link: 'link 1'
    },
    {
        icon: icon_2, 
        text: 'Option Two', 
        name: 'option two', 
        link: 'link 2'
    },
    {
        icon: icon_3, 
        text: 'Option Three', 
        name: 'option three', 
        link: 'link 3'
    }
];

<DropDownButton 
    options={options} 
    mainBgColor={rgb(14, 114, 237)}
    arrowUpIcon={upArrowImg} 
    arrowDownIcon={downArrowImg}
    defaultOption={defaultOption}
/>;

properties:

  • options - object, required
  • mainBgColor - string (RGB, RGBA, Hexadecimal..)
  • arrowUpIcon - image (png, svg...)
  • downArrowImg - image (png, svg...)
  • defaultOption - object, required

Package Sidebar

Install

npm i dropdown-react-component

Weekly Downloads

1

Version

0.0.9

License

none

Unpacked Size

135 kB

Total Files

34

Last publish

Collaborators

  • inbalchen