# Dropdownize
Dropdownize is a JavaScript library that converts an array of elements into a dropdown menu, linked to a button. It provides a simple way to create dynamic dropdown menus with customizable styles.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
## Installation
To install the project dependencies, run:
```sh
npm install
To use Dropdownize in your project, follow these steps:
-
Include the necessary HTML structure in your
index.html
file:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <button>Dropdown</button> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </body> </html>
-
Import and initialize the
DropDown
class in yoursrc/index.js
file:import DropDown from './dropdown'; const testArray = document.querySelectorAll('li'); const testDropDown = new DropDown(testArray, document.querySelector('button'));
-
Run the development server to see the dropdown in action:
npm start
To build the project, run:
npm run build
To watch for changes and rebuild automatically, run:
npm run watch
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the ISC License.
This README provides an overview of the project, instructions for installation and usage, and information on development and contributing.