odin-simple-dropdown/README.md

31 lines
591 B
Markdown
Raw Permalink Normal View History

2024-02-19 10:36:16 +00:00
# odin-simple-dropdown
Simple dropdown menu - click on button makes the menu appear :)
My first npm package with the-odin-project :D
## usage
install: `npm i odin-simple-dropdown`
import in your project:
`import dropdownMenu from "odin-simple-dropdown"`
the default style is at `./node_modules/odin-simple-dropdown/style.css` and is imported at `index.js` in the same location
### syntax
`dropdownMenu(btnTitle, ...elements)`
### example
`dropdownMenu("Dropdown!", "Home", "About", "Contact")`
it returns a dom node that you can append using append/appendChild
## license
ISC