/Justselect

Custom selectbox in pure JS and CSS.

Primary LanguageJavaScript

Justselect - Input select lightweight styling library

What is it?

Creating custom-styled select boxes was always painful. Pure CSS cannot do this and many of JavaScript libraries which can are so messy, big and contain some unnecessary things. We just wanted to get some clear and lightweight solution.

Example

Desktop iPhone

How to use it?

Basic usage

<link rel="stylesheet" href="dist/selectbox.min.css">
<script type="text/javascript" src="dist/selectbox.min.js"></script>

Add the justselect class to all <select> elements, which you want to style:

<select class="justselect">

That's all, the Justselect library will do the rest for you! That sounds great, isn't that?

You can change the look of selectboxes to your own style by editing the selectbox.scss file, which you will find in the sass directory.

Adding a label

If you want to have a Choose label in a selectbox, create an <option> with disabled and selected property in it, like this:

<option disabled selected>Choose...</option>