1.1.4 • Published 3 years ago

dynamic-dropdown-cssstyled v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Website Desktop Image

$ npm i dynamic-dropdown-cssstyled
<!-- index.html -->

<nav>
    <div>
        <button id='addDropDown'>DropDown</button>
    </div>
    <div>
        <button id='addAnotherDropDown'>Another One</button>
    </div>
</nav>    
// src/index.js

import addDropDown from "dynamic-dropdown-cssstyled";

addDropDown(
  elementToAddID,  // ID of HTML element to add dropDown to
  backgroundColor, // Color for dropDown background
  fontColor,       // Color for dropDown text
  contentToAdd     // Array of objects containing link for href as well as textContent for anchor tag
)

addDropDown("addDropDown", "#c8c6c6", "#4b6587", [
  {
    link: "http://www.google.com/",
    text: "Google",
  },
  {
    link: "https://github.com/Ishmam156",
    text: "My GitHub",
  },
]);

addDropDown("addAnotherDropDown", "pink", "purple", [
  {
    link: "http://www.google.com/",
    text: "Google",
  },
]);

Website Desktop Image Website Desktop Image 2

ISC