# vanillaSelectBox ### A nice select/multiselect ui with no dependency ![screen shot](https://raw.githubusercontent.com/PhilippeMarcMeyer/vanillaSelectBox/master/vanillaSelectBox.png) Demo : https://philippemarcmeyer.github.io/vanillaSelectBox/ ### Transform an HTML select into a selectBox dropdown #### the select is hidden and the chosen value(s) is/are available in the source select ``` let selectBox = new vanillaSelectBox("#brands",{"maxHeight":200,search:true}); ``` * param 1 : css selector of a normal select element * param 2 : options ### Available options : * maxWidth : for the UI if you don't want the title to expand to much to the right * maxHeight : the maxHeight set a scroll when there are too many items * translations : { "all": "every cars", "items": "cars" } * search : true/false, to provide a search input text to reduce the list * placeHolder : well that's a placeholder ! * stayOpen : true/false. defaut is false : that's a drop-down. Set it to true and that"s a list (>= v 0.25) ### Automatic options : * single or multiple choices : depends on the "multiple" attribute that you put in the select code * size : if you set a multiple attribute and a size attribute in the select (for instance 3) : * the title zone will enumerate the chosen values as a comma separated string until it reaches "size" * Above it will show "x items" or "x" + whatever you put in the translations.items key * If all the items are selected, it will show "all" or whatever you put in the translations.items all ```