select-button

1.0.9 • Public • Published

Dropdown menu

This dropdown menu can be used as an alternative for one branch HTML select menu

Basic structure

<div class = "drop-down" values = "..." >
    <input type = "hidden" id = "..." name = "..." >
    <button class = "select" >Select</button>
    <button class = "opt-button" value = "..." >"..."</button>
    -
    -
    -
    -
    <button class = "opt-button" value = "..." >"..."</button>
</div>

JSON file format

Developer should make a json file according to the below format and convert it using js JSON.stringfy() methord before inisialising it as the div element's 'values' attribute.

let info = {
    id: "drop-down-hidden",
    name: "drop-down-hidden",
    values: [
        {
            value: "15478478",
            text: "abc",
        },
        {
            value: "54818787",
            text: "def",
        },
        {
            value: "85255515",
            text: "ghi",
        }
    ]
};

The first two parameters are the hidden field id and name. value in values is an dropdown option's value and text is the text.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.90latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.41
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i select-button

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

4.65 kB

Total Files

3

Last publish

Collaborators

  • ravini