1.0.0 • Published 3 months ago
sbassan1-dropdown-menu v1.0.0
📌 Simple Drop-Down Menu JS Package
A simple drop-down menu JS package for personal use. Feel free to use it though! 🎉
🚀 Usage Example
import {
DropDownMenu,
DropDownMenuManager,
DropDownMenuUI,
} from "./dropdownmenu.js";
import "./style.css";
const myMenu = new DropDownMenu("DropDown Menu Name", [
{ title: "A link", link: "#" },
{ title: "A button", button: () => console.log("Button Pressed!!") },
{ title: "Another link", link: "#" },
{ title: "test", testError: "#" },
]);
const myMenuUI = new DropDownMenuUI(myMenu);
const testDiv = document.getElementsByClassName("test")[0];
testDiv.append(myMenuUI.render());
new DropDownMenuManager(myMenu, myMenuUI);
📖 How It Works :
✅ You can customize the styling, add new effects, and extend the manager class to add effects!
I hope this is useful for anyone! 😊
1.0.0
3 months ago