JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q33962F

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dropdown-react-component) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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